Android Open Source - StoichiometryForDummies Font Adapter






From Project

Back to project page StoichiometryForDummies.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project StoichiometryForDummies 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

package com.noahl98.perGProject;
/* w  w w  .jav  a2s  . c o  m*/
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class FontAdapter extends ArrayAdapter<String>{

  private final Context context;
  private final List<String> values;

    //used for changing the font of the items on the ToC
  public FontAdapter(Context context, ArrayList<String> values){
    super(context, R.layout.menu_item, values);
    this.context=context;
    this.values=values;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent){
    
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
    View rowView = inflater.inflate(R.layout.menu_item, parent, false);
    TextView textView =(TextView) rowView.findViewById(R.id.label);
    
    textView.setText(values.get(position).toString());
    textView.setTypeface(LauncherMenu.stoneBird);
    
    return rowView;
  }
}




Java Source Code List

com.noahl98.perGProject.BalancingFragment.java
com.noahl98.perGProject.BuildConfig.java
com.noahl98.perGProject.FontAdapter.java
com.noahl98.perGProject.IntroFragment.java
com.noahl98.perGProject.LauncherMenu.java
com.noahl98.perGProject.LinksFragment.java
com.noahl98.perGProject.MainMenuActivity.java
com.noahl98.perGProject.MoleFragment.java
com.noahl98.perGProject.RatioFragment.java
com.noahl98.perGProject.ReagentFragment.java
com.noahl98.perGProject.SignificantFragment.java
com.noahl98.perGProject.YieldFragment.java