Skip to content

Commit

Permalink
add nn uncertain route state
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Jan 31, 2020
1 parent 0a11b59 commit cc381e3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
mapboxSdkDirectionsModels : '5.1.0-SNAPSHOT',
mapboxEvents : '4.5.1',
mapboxCore : '1.3.0',
mapboxNavigator : 'mvr-to-nikita-SNAPSHOT-1',
mapboxNavigator : 'ms-grace-period-after-set-route-SNAPSHOT-13',
mapboxCrashMonitor : '2.0.0',
mapboxAnnotationPlugin : '0.7.0',
mapboxAccounts : '0.2.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ enum class RouteProgressState {
* A lack of [android.location.Location] updates from the phone has caused lack of confidence in the
* progress updates being sent.
*/
LOCATION_STALE
LOCATION_STALE,

ROUTE_UNCERTAIN
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class RouteProgressStateMap : HashMap<RouteState, RouteProgressState?>() {
put(RouteState.COMPLETE, RouteProgressState.ROUTE_ARRIVED)
put(RouteState.TRACKING, RouteProgressState.LOCATION_TRACKING)
put(RouteState.STALE, RouteProgressState.LOCATION_STALE)
put(RouteState.UNCERTAIN, RouteProgressState.ROUTE_UNCERTAIN)
put(RouteState.OFFROUTE, null) // Ignore off-route (info already provided via listener)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ enum class RouteProgressState {
ROUTE_INITIALIZED,
ROUTE_ARRIVED,
LOCATION_TRACKING,
LOCATION_STALE
LOCATION_STALE,
ROUTE_UNCERTAIN
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,6 @@ private fun RouteState.convertState(): RouteProgressState? {
RouteState.COMPLETE -> RouteProgressState.ROUTE_ARRIVED
RouteState.OFFROUTE -> null // send in a callback instead
RouteState.STALE -> RouteProgressState.LOCATION_STALE
RouteState.UNCERTAIN -> RouteProgressState.ROUTE_UNCERTAIN
}
}

0 comments on commit cc381e3

Please sign in to comment.