Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Expose LocationUpdate builder and immediate location animation when resuming the map #604

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

LukasPaczos
Copy link

@LukasPaczos LukasPaczos commented Oct 21, 2020

With this update, we're consolidating all options available to developers when they are driving their own location updates. This deprecates the lookAhead flag and in return exposes an option to completely control the animation duration of the puck and camera location transitions. This can be used for the lookAhead animation, or for situational change in the animation duration, for example, if an immediate transition is necessary instead of a smooth one.

This also makes the transition to the last location instantaneous when the component is re-enabled or the map is resumed, instead of smoothly trying to catch-up. This prevents the puck from gliding over buildings and cutting corners to synchronize with the current location.

<changelog>Added `LocationUpdate.Builder` which simplifies customization of forced location updates. It also opens up the option to fully control the animation duration of the location tracking transitions.</changelog>

<changelog>Instantly transition to the last location when the location component is re-enabled or the map is resumed. This prevents the puck from gliding over buildings and cutting corners to synchronize with the current location after coming from the background.</changelog>

/cc @mapbox/navigation-android

@LukasPaczos LukasPaczos requested a review from a team October 21, 2020 15:34
@LukasPaczos LukasPaczos force-pushed the lp-immediate-location-animation branch 2 times, most recently from 10ea470 to 5eb0803 Compare October 21, 2020 16:04
*/
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps do not see whole picture but why is logic changed for already deprecated method?
IMHO it should have worked the same way it did before while new non-deprecated method is introduced.

Copy link
Author

Choose a reason for hiding this comment

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

I moved the calculation of duration out of the animator coordinator to maintain compatibility since the coordinator now accepts the duration as an argument.

…esuming the map

With this update, we're consolidating all options available to developers when they are driving their own location updates. This deprecates the lookAhead flag and in return exposes an option to completely control the animation duration of the puck and camera location transitions. This can be used for the lookAhead animation, or for situational change in the animation duration, for example, if an immediate transition is necessary instead of a smooth one.
@LukasPaczos LukasPaczos force-pushed the lp-immediate-location-animation branch from 5eb0803 to 3d2fa43 Compare October 22, 2020 09:23
Copy link
Contributor

@kiryldz kiryldz left a comment

Choose a reason for hiding this comment

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

Code LGTM assuming it's tested in some real navigation case and works as expected.

@LukasPaczos
Copy link
Author

LukasPaczos commented Oct 22, 2020

I updated the OP to reflect all of the changes that this PR brings. I also tested a local snapshot with our drive testing app and the instant resume feature as well as backward compatibility look good 👍

@LukasPaczos LukasPaczos merged commit 9f4a5c6 into main Oct 22, 2020
@LukasPaczos LukasPaczos deleted the lp-immediate-location-animation branch October 22, 2020 09:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants