/** * Copyright © 2013 Titan Framework. All Rights Reserved. * * Developed by Laboratory for Precision Livestock, Environment and Software Engineering (PLEASE Lab) * of Embrapa Beef Cattle at Campo Grande - MS - Brazil. * * @see http://please.cnpgc.embrapa.br * * @author Camilo Carromeu * @author Jairo Ricardes Rodrigues Filho * * @version -1-alpha */ package .adapter; import java.util.List; import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import .R; import .model.; public class ListAdapter extends ArrayAdapter<> { public ListAdapter (Context context, List<> list) { super (context, 0, list); } public View getView (int position, View view, ViewGroup parent) { if (view == null) view = LayoutInflater.from (getContext ()).inflate (R.layout._row, null); ImageView image = (ImageView) view.findViewById (R.id._row_image); if (getItem (position).getImage () != 0) (new LoadUrlImageTask (image, "http://www./photo/" + getItem (position).getImage () + "_0x100_0.jpg", context)).execute (); TextView title = (TextView) view.findViewById (R.id._row_title); title.setText (getItem (position).getTitle ()); TextView title = (TextView) view.findViewById (R.id._row_description); title.setText (getItem (position).getDescription ()); return view; } }