Add platform info to departures listing

This commit is contained in:
Doug Keen 2013-07-28 17:47:57 -07:00
parent 9bfff84165
commit 6f18d4877a
4 changed files with 10 additions and 6 deletions

View File

@ -471,7 +471,7 @@ public class ViewDeparturesActivity extends Activity implements
if (mActionMode == null)
mActionMode = startActionMode(new DepartureActionMode());
mActionMode.setTitle(mSelectedDeparture.getTrainDestinationName());
mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthText());
mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthAndPlatform());
}
private class DepartureActionMode implements ActionMode.Callback {

View File

@ -114,7 +114,7 @@ public class YourTrainLayout extends RelativeLayout implements Checkable {
.setText(boardedDeparture.getTrainDestination().toString());
((TextView) findViewById(R.id.yourTrainTrainLengthText))
.setText(boardedDeparture.getTrainLengthText());
.setText(boardedDeparture.getTrainLengthAndPlatform());
ImageView colorBar = (ImageView) findViewById(R.id.yourTrainDestinationColorBar);
((GradientDrawable) colorBar.getDrawable()).setColor(Color

View File

@ -98,7 +98,7 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
.findViewById(R.id.estimatedArrival);
if (estimatedArrival != null) {
((TextView) view.findViewById(R.id.trainLengthText))
.setText(departure.getTrainLengthText());
.setText(departure.getTrainLengthAndPlatform());
estimatedArrival.setText(arrivesAtDestinationPrefix
+ estimatedArrivalTimeText);
} else {
@ -111,13 +111,13 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
textSwitcher.setCurrentText(arrivesAtDestinationPrefix
+ estimatedArrivalTimeText);
} else {
textSwitcher.setCurrentText(departure.getTrainLengthText());
textSwitcher.setCurrentText(departure.getTrainLengthAndPlatform());
}
textSwitcher.setTextProvider(new TextProvider() {
@Override
public String getText(long tickNumber) {
if (tickNumber % 4 == 0) {
return departure.getTrainLengthText();
return departure.getTrainLengthAndPlatform();
} else {
final String estimatedArrivalTimeText = departure
.getEstimatedArrivalTimeText(getContext());

View File

@ -172,7 +172,11 @@ public class Departure implements Parcelable, Comparable<Departure> {
}
public String getTrainLengthText() {
return trainLength + " car train";
return trainLength + " cars";
}
public String getTrainLengthAndPlatform() {
return trainLength + " cars, platform " + getPlatform();
}
public boolean getRequiresTransfer() {