@Override
public ListViewRow getListViewRowForSectionAndRow(int sectionIndex,
int rowIndex) {
ListViewRow row = new ListViewRow();
switch (sectionIndex) {
case 0: {
StopBean stop = _data.getStop();
row.setStyle(ListViewRowStyle.DEFAULT);
row.setText(stop.getName());
if (stop.getDirection() != null || stop.getCode() != null) {
row.setStyle(ListViewRowStyle.DETAIL);
StringBuilder b = new StringBuilder();
if (stop.getDirection() != null)
b.append(stop.getDirection()).append(" bound - ");
if (stop.getCode() != null)
b.append("Stop # ").append(stop.getCode());
row.setDetailText(b.toString());
}
break;
}
case 1: {
List<ArrivalAndDepartureBean> arrivalsAndDepartures = _data.getArrivalsAndDepartures();
ArrivalAndDepartureBean arrival = arrivalsAndDepartures.get(rowIndex);
Widget view = getCustomViewForArrivalAndDeparture(arrival);
row.setCustomView(view);
break;
}
case 2: {
row.setStyle(ListViewRowStyle.DEFAULT);
row.setText("Add bookmark");
break;
}
}
return row;