use of com.example.androidforios.app.data.model.Prediction in project AndroidForiOS by smbarne.
the class PredictionArrayAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Prediction prediction = this.getItem(position);
View inflatedView = convertView;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflatedView = inflater.inflate(LAYOUT_RESOURCE_ID, parent, false);
}
TextView stopNameTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_left_text_view);
TextView middleTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_middle_text_view);
TextView stopSecondsTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_right_text_view);
stopNameTextView.setText(prediction.stopName);
middleTextView.setVisibility(View.GONE);
stopSecondsTextView.setText(prediction.stopSeconds.toString());
return inflatedView;
}
use of com.example.androidforios.app.data.model.Prediction in project AndroidForiOS by smbarne.
the class TripDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Prediction[] predictions = mTrip.predictions.toArray(new Prediction[mTrip.predictions.size()]);
PredictionArrayAdapter predictionArrayAdapter = new PredictionArrayAdapter(getActivity().getApplicationContext(), predictions);
setListAdapter(predictionArrayAdapter);
return super.onCreateView(inflater, container, savedInstanceState);
}
Aggregations