Back to project page TAQueue.
The source code is released under:
MIT License
If you think the Android project TAQueue listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.familybiz.greg.taqueue.view.queue; /*from w w w .ja va 2 s. c om*/ import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.familybiz.greg.taqueue.R; /** * Created by Greg Anderson */ public class ColorableTAArrayAdapter extends ArrayAdapter<String> { private int[] mTAColors; public ColorableTAArrayAdapter(Context context, int resource) { super(context, resource); mTAColors = getContext().getResources().getIntArray(R.array.ta_colors); } @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = (TextView)super.getView(position, convertView, parent); textView.setBackgroundColor(mTAColors[position]); if (textView.getText().toString().equals(getContext().getString(R.string.no_tas_on_duty))) textView.setBackgroundColor(getContext().getResources().getColor(R.color.light_background_color)); return textView; } }