Back to project page MightyV.
The source code is released under:
Apache License
If you think the Android project MightyV 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.indivisible.mightyv.util; /* www . j a va2 s . c o m*/ 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; import com.indivisible.mightyv.R; import com.indivisible.mightyv.data.Show; public class ShowArrayAdapter extends ArrayAdapter<Show> { //// data private String TAG; private final Context context; private final List<Show> shows; //// constructor public ShowArrayAdapter(Context context, List<Show> shows) { super(context, R.layout.show_row_simple, shows); this.TAG = this.getClass().getSimpleName(); this.context = context; this.shows = shows; } //// override methods @Override public View getView(int position, View convertView, ViewGroup parent) { //if (MyLog.debug) MyLog.d(TAG, "Creating Adapter View..."); LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowShowSimple = inflater.inflate(R.layout.show_row_simple, parent, false); TextView showTitle = (TextView) rowShowSimple .findViewById(R.id.row_showsimple_text_title); TextView showStatus = (TextView) rowShowSimple .findViewById(R.id.row_showsimple_text_status); TextView showYears = (TextView) rowShowSimple .findViewById(R.id.row_showsimple_text_years); TextView showCountry = (TextView) rowShowSimple .findViewById(R.id.row_showsimple_text_country); //ImageView iconStatus = (ImageView) rowShowSimple.findViewById(R.id.row_showsimple_icon_status); showTitle.setText(shows.get(position).getTitle()); showStatus.setText(shows.get(position).getStatus()); showYears.setText(shows.get(position).getYearsString()); showCountry.setText(shows.get(position).getCountry()); //TODO assign iconStatus here based on show status return rowShowSimple; } }