OneBusAway / onebusaway-windows-phone

Source code for the OneBusAway mobile app on Windows Phone
10 stars 14 forks source link

Add support for experimental regions #7

Open barbeau opened 10 years ago

barbeau commented 10 years ago

As discussed on the OBA dev list, we'd like to support experimental regions in the OBA apps.

Per additional discussion here, we're going to leave the current Regions API (http://regions.onebusaway.org/regions.json) as a legacy API to be used by apps that haven't yet been updated to filter out experimental regions by default.

Therefore, when the app is updated to handle experimental regions, it should use the new Regions API v3 URL, which will contain experimental regions (http://regions.onebusaway.org/regions-v3.json). This also means that we can proceed with deploying an updated app that supports experimental regions without waiting for the other apps to be updated.

So, this would involve:

  1. Consuming a new experimental boolean value for each region from the Regions API v3
  2. Only use regions with experimental set to false AND active set to true, by default
  3. Allowing the user to opt-in to including experimental regions (i.e., experimental set to true) for manual or automatic selection, via a preference

If the user chooses to enabled this option, a message is displayed " Experimental regions may be unstable and without real-time info. Go ahead?". If the user selects "Yes", then regions with experimental set to true AND active set to true are used in the app for both manual and automatic region selection. If the user deselects "Enabled experimental regions", or cancels out of the enabling dialog, then all regions with "experimental" set to true are again removed from consideration in the app (i.e., same as default setting). Note that if the user currently has an experimental region selected, then we should warn them that their current region will no longer be available if they deselect experimental regions.

I would suggest viewing the current Android experience on an actual device, if possible. Below is the experience on Android in screenshots, for visual illustration.

Default preferences screen:

image

User checks the "Experimental regions" box and sees this dialog:

image

If the user has an experimental region selected, and they try to deselect the "Experimental regions" preference, they will see the following dialog:

image