Changed estimated arrival text to emphasize arrival at *destination*

This commit is contained in:
Doug Keen 2012-10-21 12:31:24 -07:00
parent 05c6c2298a
commit 5f04b943ea
2 changed files with 52 additions and 48 deletions

View File

@ -1,47 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">BART Runner</string> <string name="app_name">BART Runner</string>
<string name="favorite_routes">Favorite routes</string> <string name="favorite_routes">Favorite routes</string>
<string name="empty_favorites_list_message">No favorite routes have been added yet</string> <string name="empty_favorites_list_message">No favorite routes have been added yet</string>
<string name="loading_message">Loading, please wait&#8230;</string> <string name="loading_message">Loading, please wait&#8230;</string>
<string name="add_route">Add a route</string> <string name="add_route">Add a route</string>
<string name="origin">Origin</string> <string name="origin">Origin</string>
<string name="destination">Destination</string> <string name="destination">Destination</string>
<string name="save">Save</string> <string name="save">Save</string>
<string name="error_matching_origin_and_destination">The origin and destination stations must be <string name="error_matching_origin_and_destination">The origin and destination stations must be
different</string> different</string>
<string name="error_null_destination">You must select a destination station</string> <string name="error_null_destination">You must select a destination station</string>
<string name="error_null_origin">You must select an origin station</string> <string name="error_null_origin">You must select an origin station</string>
<string name="departure_wait_message">Please wait while real time departure data is <string name="departure_wait_message">Please wait while real time departure data is
loaded</string> loaded</string>
<string name="no_data_message">No departure data is currently available for this <string name="no_data_message">No departure data is currently available for this
route. Note that this route may require a non-standard transfer due to route. Note that this route may require a non-standard transfer due to
a temporary change in service. Check for service advisories posted at a temporary change in service. Check for service advisories posted at
http://m.bart.gov/schedules/advisories/</string> http://m.bart.gov/schedules/advisories/</string>
<string name="view">View</string> <string name="view">View</string>
<string name="view_departures">View departures</string> <string name="view_departures">View departures</string>
<string name="missing_departure">Missing/inaccurate departure? Feature request? Please report to bartrunner@dougkeen.com</string> <string name="missing_departure">Missing/inaccurate departure? Feature request? Please report to bartrunner@dougkeen.com</string>
<string name="delete">Delete</string> <string name="delete">Delete</string>
<string name="yes">Yes</string> <string name="yes">Yes</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="view_on_bart_site">View details on BART site</string> <string name="view_on_bart_site">View details on BART site</string>
<string name="could_not_connect">Could not connect to BART services. Please try <string name="could_not_connect">Could not connect to BART services. Please try
again later.</string> again later.</string>
<string name="also_add_return_route">Also add return route</string> <string name="also_add_return_route">Also add return route</string>
<string name="view_system_map">View system map</string> <string name="view_system_map">View system map</string>
<string name="system_map">System map</string> <string name="system_map">System map</string>
<string name="departures">Departures</string> <string name="departures">Departures</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="quick_departure_lookup">Quick departure lookup</string> <string name="quick_departure_lookup">Quick departure lookup</string>
<string name="getting_on_this_train">I will board this train</string> <string name="getting_on_this_train">I will board this train</string>
<string name="departure_options">Departure options</string> <string name="departure_options">Departure options</string>
<string name="your_train">Your train</string> <string name="your_train">Your train</string>
<string name="set_up_departure_alarm">Set up departure alarm</string> <string name="set_up_departure_alarm">Set up departure alarm</string>
<string name="train_alarm_text">Your train is leaving soon!</string> <string name="train_alarm_text">Your train is leaving soon!</string>
<string name="silence_alarm">Silence alarm</string> <string name="silence_alarm">Silence alarm</string>
<string name="cancel_alarm">Cancel alarm</string> <string name="cancel_alarm">Cancel alarm</string>
<string name="set_alarm">Set alarm</string> <string name="set_alarm">Set alarm</string>
<string name="leaving">Leaving</string> <string name="leaving">Leaving</string>
<string name="departed">Departed</string> <string name="departed">Departed</string>
<string name="arrives_at_destination">Arrive @ dest. ~</string>
</resources> </resources>

View File

@ -77,10 +77,12 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
.findViewById(R.id.trainLengthText); .findViewById(R.id.trainLengthText);
initTextSwitcher(textSwitcher); initTextSwitcher(textSwitcher);
final String arrivesAtDestinationPrefix = getContext().getString(
R.string.arrives_at_destination);
final String estimatedArrivalTimeText = departure final String estimatedArrivalTimeText = departure
.getEstimatedArrivalTimeText(getContext()); .getEstimatedArrivalTimeText(getContext());
if (!StringUtils.isBlank(estimatedArrivalTimeText)) { if (!StringUtils.isBlank(estimatedArrivalTimeText)) {
textSwitcher.setCurrentText("Est. arrival " textSwitcher.setCurrentText(arrivesAtDestinationPrefix
+ estimatedArrivalTimeText); + estimatedArrivalTimeText);
} else { } else {
textSwitcher.setCurrentText(departure.getTrainLengthText()); textSwitcher.setCurrentText(departure.getTrainLengthText());
@ -96,7 +98,8 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
if (StringUtils.isBlank(estimatedArrivalTimeText)) { if (StringUtils.isBlank(estimatedArrivalTimeText)) {
return ""; return "";
} else { } else {
return "Est. arrival " + estimatedArrivalTimeText; return arrivesAtDestinationPrefix
+ estimatedArrivalTimeText;
} }
} }
} }