-
Notifications
You must be signed in to change notification settings - Fork 318
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 NavigationCamera#update for MapboxMap animations #1849
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 One minor comment + missing javadoc and should be ready to go.
|
||
private boolean isTracking() { | ||
int cameraMode = mapboxMap.getLocationComponent().getCameraMode(); | ||
return cameraMode == CameraMode.TRACKING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only check if cameraMode != CameraMode.NONE
.
handle(update, durationMs, callback); | ||
} | ||
|
||
private void handle(NavigationCameraUpdate update, int durationMs, MapboxMap.CancelableCallback callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: this method is not called from anywhere else, it can just be cut and pasted into render
.
0da6119
to
01d280e
Compare
@@ -212,6 +221,53 @@ public void showRouteOverview(int[] padding) { | |||
animateCameraForRouteOverview(routeInformation, padding); | |||
} | |||
|
|||
/** | |||
* Animate the camera to a new location defined within {@link CameraUpdate} passed to the | |||
* {@link NavigationCameraUpdate} using a transition animation that evokes powered flight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to add something along the lines of
... that evokes powered flight. If the camera is in a tracking mode, this animation is going to be ignored, or break the tracking, based on the
CameraUpdateMode
.
to each javadoc entry?
01d280e
to
a39cf73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
a39cf73
to
0fe8594
Compare
0fe8594
to
999120d
Compare
Codecov Report
@@ Coverage Diff @@
## master #1849 +/- ##
============================================
+ Coverage 31.86% 32.14% +0.28%
- Complexity 949 964 +15
============================================
Files 244 248 +4
Lines 8537 8577 +40
Branches 647 651 +4
============================================
+ Hits 2720 2757 +37
- Misses 5570 5572 +2
- Partials 247 248 +1 |
Description
The
NavigationCamera
currently has a few tracking modes that make it simple for developers to engage or disengage camera tracking behavior. Although when tracking is engaged and, simultaneously, a normalMapboxMap
animation such asMapboxMap#animateCamera
conflict can occur as the animation fights our current tracking state.What's the goal?
The goal is to better organize this experience for developers. We should have explicit options that clearly determine / state the behavior for these two APIs interacting.
How is it being implemented?
New APIs:
new NavigationCameraUpdate(CameraUpdate)
#setMode(CameraUpdateMode)
- determines behavior with trackingenum CameraUpdateMode
DEFAULT
- if tracking or resetting, provided animation will be ignoredOVERRIDE
- if tracking or retting,LocationComponent
will be set to trackingNONE
and animation will fireExample usage:
Screenshots or Gifs
Code driving this
.gif
(DEFAULT
behavior):Code driving this
.gif
(OVERRIDE
behavior):How has this been tested?
ComponentNavigationActivity
Checklist
SNAPSHOT
upstream dependencies if needed)Activity
example in the test app showing the new feature implemented