Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add route overview #4142

Merged
merged 1 commit into from
Mar 17, 2021
Merged

add route overview #4142

merged 1 commit into from
Mar 17, 2021

Conversation

abhishek1508
Copy link
Contributor

Description

Fixes #885

Changelog

<changelog>Introduce route overview button.</changelog>

Screenshots or Gifs

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #4142 (b965b46) into main (70377be) will decrease coverage by 0.40%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #4142      +/-   ##
============================================
- Coverage     59.94%   59.53%   -0.41%     
  Complexity     2357     2357              
============================================
  Files           328      330       +2     
  Lines         14158    14255      +97     
  Branches       1682     1685       +3     
============================================
  Hits           8487     8487              
- Misses         4850     4947      +97     
  Partials        821      821              
Impacted Files Coverage Δ Complexity Δ
...n/ui/maps/camera/view/MapboxRouteOverviewButton.kt 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../navigation/ui/utils/internal/extensions/ViewEx.kt 0.00% <0.00%> (ø) 0.00 <0.00> (?)

@abhishek1508 abhishek1508 force-pushed the ak-route-overview branch 2 times, most recently from 8b86511 to d05ddc9 Compare March 16, 2021 21:45
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this found some weird behaviors with the animation 👀

overview_button

It also seems that only works the very first time i.e. panning the map and re-click does nothing.

Also found that the OVERVIEW text is cut in my device 👀

overview_text_cut

@abhishek1508
Copy link
Contributor Author

It also seems that only works the very first time i.e. panning the map and re-click does nothing.

Doesn't happen to me cc @Guardiola31337

@abhishek1508 abhishek1508 force-pushed the ak-route-overview branch 3 times, most recently from a5b2a0b to 553d5e1 Compare March 17, 2021 17:05
@LukasPaczos
Copy link
Member

This diff resolves some of the animations + gestures issues:

diff --git a/test-app/src/main/java/com/mapbox/navigation/examples/core/MapboxNavigationActivity.kt b/test-app/src/main/java/com/mapbox/navigation/examples/core/MapboxNavigationActivity.kt
index 4e432566d..0d3fa203f 100644
--- a/test-app/src/main/java/com/mapbox/navigation/examples/core/MapboxNavigationActivity.kt
+++ b/test-app/src/main/java/com/mapbox/navigation/examples/core/MapboxNavigationActivity.kt
@@ -59,6 +59,7 @@ import com.mapbox.navigation.ui.maneuver.model.StepDistanceError
 import com.mapbox.navigation.ui.maps.camera.NavigationCamera
 import com.mapbox.navigation.ui.maps.camera.data.MapboxNavigationViewportDataSource
 import com.mapbox.navigation.ui.maps.camera.data.MapboxNavigationViewportDataSourceOptions
+import com.mapbox.navigation.ui.maps.camera.lifecycle.NavigationBasicGesturesHandler
 import com.mapbox.navigation.ui.maps.location.NavigationLocationProvider
 import com.mapbox.navigation.ui.maps.route.arrow.api.MapboxRouteArrowApi
 import com.mapbox.navigation.ui.maps.route.arrow.api.MapboxRouteArrowView
@@ -314,6 +315,9 @@ class MapboxNavigationActivity :
             binding.mapView.getCameraAnimationsPlugin(),
             viewportDataSource
         )
+        binding.mapView.getCameraAnimationsPlugin().addCameraAnimationsLifecycleListener(
+            NavigationBasicGesturesHandler(navigationCamera)
+        )
         init()
         tripProgressApi = MapboxTripProgressApi(getTripProgressFormatter())
         maneuverApi = MapboxManeuverApi(

Not sure if this was exactly what you were struggling with though @Guardiola31337.

@LukasPaczos
Copy link
Member

Does the overview button need to have the text? It makes sense for a muted/unmuted button that has different states, but should that also be the case for an overview that is only one action?

/cc @d-prukop

@abhishek1508
Copy link
Contributor Author

Does the overview button need to have the text? It makes sense for a muted/unmuted button that has different states, but should that also be the case for an overview that is only one action?

/cc @d-prukop

Yeah, I think it makes sense to show this optional text, because we had customers who wanted the text because they didn't know what these buttons are for. So this API in the MapboxRouteOverviewButton is optional. If your requirement is not to show it, don't invoke the API. You could just set the click listener on the button and change the camera angles and not invoke the API.

This API is best served when you show the button for the first time, then you can invoke the API and the user can see the text. Next time onwards don't show it.

Same applies to Recenter Button

cc @LukasPaczos @d-prukop

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overview_button_route_not_properly_centered

Noting that route overview is not implemented properly in the example as my current location and some part of the route is hidden by the maneuver view and the trip progress view.

@abhishek1508
Copy link
Contributor Author

Noting that route overview is not implemented properly in the example as my current location and some part of the route is hidden by the maneuver view and the trip progress view.

Thanks for pointing it out @Guardiola31337. This issue is more related to how the edgeInsets have been defined in the MapboxNavigationActivity. It will be fixed in a separate PR.

@abhishek1508 abhishek1508 merged commit 5699bf9 into main Mar 17, 2021
@abhishek1508 abhishek1508 deleted the ak-route-overview branch March 17, 2021 23:49
@LukasPaczos
Copy link
Member

@abhishek1508 could you add tests for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants