Open barbeau opened 8 years ago
Here is an example of how warnings (left, yellow) and errors (left, red) appear in OBA Android when looking at a stop, and on the right is the alert dialog after you tap on it.
The user can hide the alerts by tapping "Hide" in the dialog, in which case a small green ribbon appears at the stop of the list. The user can click on "Shop all" in the green ribbon if they want to see any hidden alerts they've previously hidden:
Summary:
We currently don't do a very good job of sharing information with agencies for how service alerts appear in Android or iOS, including configuration changes agencies can make to change the presentation of the alert.
On OBA Android, here's our mapping of colors of the alerts to the "Severity" level of alerts:
We should create better documentation for this for agencies as well as developers - right now "situation" elements aren't documented in the REST API docs for the main arrivals-and-departures-for-stop API: http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/elements/arrival-and-departure.html
It looks like the situation element docs are someone hidden – there isn’t a link to them anywhere, but if you follow the same URL pattern you get http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/elements/situation.html. I’ve never reviewed these, so I don’t know if they reflect the current state of the API.
Here's an example REST API request - as of June 2018 HART has a few active alerts, which show up as
situation
elements in thereferences
section: http://api.tampa.onebusaway.org/api/api/where/arrivals-and-departures-for-stop/Hillsborough%20Area%20Regional%20Transit_6497.json?minutesAfter=65&app_ver=91&version=2&key=TESTI’ve grabbed some past arrivals-and-departues-for-stop API responses that I’ve used in unit tests for Android – here are the files: • https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/androidTest/res/raw/arrivals_and_departures_for_stop_dart_4041_alerts.json • https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/androidTest/res/raw/arrivals_and_departures_for_stop_psta_4077_alerts.json • https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/androidTest/res/raw/arrivals_and_departures_for_stop_mts_11670_route_alerts.json • https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/androidTest/res/raw/arrivals_and_departures_for_stop_mts_13353_route_and_stop_alerts.jso
The unit tests that use these files are here – just search for the word “situation” in the method names: https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/androidTest/java/org/onebusaway/android/io/test/ArrivalInfoRequestTest.java
We should also try to normalize colors and other presentation with OBA iOS.