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) if (mActionMode == null)
mActionMode = startActionMode(new DepartureActionMode()); mActionMode = startActionMode(new DepartureActionMode());
mActionMode.setTitle(mSelectedDeparture.getTrainDestinationName()); mActionMode.setTitle(mSelectedDeparture.getTrainDestinationName());
mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthText()); mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthAndPlatform());
} }
private class DepartureActionMode implements ActionMode.Callback { private class DepartureActionMode implements ActionMode.Callback {

View File

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

View File

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

View File

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