Android Open Source - FindYourWords Dialog Credits






From Project

Back to project page FindYourWords.

License

The source code is released under:

Apache License

If you think the Android project FindYourWords listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * Class DialogSaveFile is a Dialog used in the first Activity to save a txt file
 * In this dialog the user can write the name of the file e save it in the SDcard
 * /*  w ww  . j av a  2  s .co m*/
 * @author Sara Craba
 * @version 1.0
 */

package dialog;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.sara.find_your_words.R;

/**
 * @see DialogFragment() on Android
 */
public class DialogCredits extends DialogFragment 
{
  private TextView allTextView;
  private View view;
  
  //Credit text view is a formatted text, I need to declare it in the main activity
  public static TextView creditText;
  
  //font implementation  
  private Typeface type;
  private static final int TEXT_SIZE=20;
    
  /**
   * @see onCreateDialog() on Android Dialogs class
   */
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) 
  {
    //get the layout inflater
    LayoutInflater inflater = getActivity().getLayoutInflater();
    
    //get view
    view=inflater.inflate(R.layout.dialog_credits, null);
    
    type =Typeface.createFromAsset(getActivity().getAssets(),"jennifer.ttf");

    creditText= (TextView)view.findViewById(R.id.apache);
    creditText.setText(Html.fromHtml(getString(R.string.copyright)));
    drawText(R.id.my_name);
    drawText(R.id.external_libreries);
    drawText(R.id.apache);
    
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    // inflate and set the layout for the dialog
    // pass null as the parent view because its going in the dialog layout
    builder.setView(view)
    //button Ok save the file
    .setPositiveButton("Done", new DialogInterface.OnClickListener()
    {
      @Override
      public void onClick(DialogInterface dialog, int id)
      {
        DialogCredits.this.getDialog().cancel();
      }
    });
    return builder.create();
  }
  
  private void drawText(int id){
    allTextView= (TextView) view.findViewById(id);
    allTextView.setTypeface(type,0);
    allTextView.setTextSize(TEXT_SIZE);
  }
}




Java Source Code List

com.ipaulpro.afilechooser.FileChooserActivity.java
com.ipaulpro.afilechooser.FileListAdapter.java
com.ipaulpro.afilechooser.FileListFragment.java
com.ipaulpro.afilechooser.FileLoader.java
com.ipaulpro.afilechooser.utils.FileUtils.java
com.ipaulpro.afilechooser.utils.MimeTypeParser.java
com.ipaulpro.afilechooser.utils.MimeTypes.java
dialog.DialogCredits.java
dialog.DialogInfoMain.java
dialog.DialogInfo.java
dialog.DialogSaveFile.java
grid.CaptureWord.java
grid.Cell.java
grid.GridManager.java
grid.LetterView.java
grid.LineDrawView.java
grid.Positions.java
grid.RelativeLayoutView.java
mainClasses.MainActivity.java
mainClasses.SetWords.java
win.DialogWinThread.java
win.DialogWin.java
win.WinView.java
word.CompareStringList.java
word.OneWord.java