Back to project page MassRoute.
The source code is released under:
Copyright (c) 2010 Todd Anderson http://www.custardbelly.com/blog Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (th...
If you think the Android project MassRoute 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.custardbelly.massdot.view.adapter; /*from ww w . j a v a2s . 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.custardbelly.massdot.R; import com.custardbelly.massdot.model.StopPrediction; public class StopPredictionsAdapter extends ArrayAdapter<StopPrediction> { private LayoutInflater inflater; private int rowViewResource; private List<StopPrediction> predictions; public StopPredictionsAdapter( Context context, int rowViewResource, List<StopPrediction> predictions ) { super( context, rowViewResource, predictions ); this.predictions = predictions; this.rowViewResource = rowViewResource; this.inflater = LayoutInflater.from( context ); } @Override public View getView( int position, View convertView, ViewGroup parent ) { View view = convertView; StopPrediction prediction = predictions.get( position ); if( view == null ) { view = inflater.inflate( rowViewResource, null ); } if( prediction != null ) { TextView titleView = (TextView) view.findViewById(R.id.predictionTitle); if( titleView != null ) { titleView.setText( Integer.toString( prediction.getMinutes() ) ); } } return view; } }