phunware / maas-mapping-android-sdk

Phunware Mapping SDK for Android
0 stars 6 forks source link

SWMAAS-734 Add route summary #90

Closed npike closed 4 years ago

npike commented 4 years ago

This PR adds the missing Route Summary UI to the Routing Scenario, and by extension Walk Time Scenario and Voice Prompt Scenario.

I have broken this up into a couple commits for ease of review, but they will be squashed into one after review is complete.

1d70987 There is already extensive logic for how to render a Maneuver for a ViewPager, I have refactored this logic (NavigationOverlayView) so that it can be used by any other class that wishes to render a Maneuver into a layout. (In the case of this PR, a RecyclerView Adapter)

1acb66d Implements the RouteSummaryFragment. This is a Fragment that is responsible for showing a list of maneuvers given a RouteOptions object. The fragment has hide() and show() methods that can be called from Scenarios when they wish to show or hide the Route Summary.

The designs call for an "arrival" step in Route Summary, so this Fragment handles that by leveraging an adapter count that is 1 more than the actual maneuvers count. The last Adapter item will be "You have arrived at" + the destination POI name. i.e. "You have arrived at Break Room"

dc38176 Adds RouteSummaryFragment to RouteActivity, and wires up the "down" arrow on the current maneuver display to show it.

Pressing the device back button, the toolbar cancel button, or the "Exit" button on the walking time card while RouteSummary is shown will hide it.

Additional notes

Demo

swmaas734_route_summary