private static class MyAdapter extends ArrayAdapter<String> {
private String[] data1, data2, data3;
private Typeface tf;
public MyAdapter(Context context, int resource, int textViewResourceId,
String[] data1, String[] data2, String[] data3) {
super(context, resource, textViewResourceId, data2);
this.data1 = data1;
this.data2 = data2;
this.data3 = data3;
this.tf = Typeface.createFromAsset(context.getAssets(),
"fonts/segoeuil.ttf");
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = super.getView(position, convertView, parent);
if (position == 0) {
v.setBackgroundColor(Color.LTGRAY);
} else {v.setBackgroundResource(android.R.drawable.list_selector_background);}
TextView t1 = (TextView) v.findViewById(R.id.data1);
t1.setText(data1[position]);
t1.setTypeface(tf);
TextView t2 = (TextView) v.findViewById(R.id.data2);
t2.setText(data2[position]);
t2.setTypeface(tf);
TextView t3 = (TextView) v.findViewById(R.id.data3);
t3.setText(data3[position]);
t3.setTypeface(tf);
return v;
}
@Override
public boolean isEnabled(int position) {
return position == 0 ? false : true;
}
@Override
public String getItem(int position) {
// TODO Auto-generated method stub
return super.getItem(position);
}