Repository navigation
fix(android): keep camera animations when edge insets change - #101
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 of 8 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Android, an edge inset change cancels a running
moveCameraorfitCoordinatesanimation.GoogleMapProvider.setEdgeInsetsre-centers withmap.moveCamera(...), and any camera update stops the animation in flight. React Native on Android also runs view commands before prop updates from the same frame, so a refit right after anedgeInsetsprop change starts against the old insets, then the prop update cancels it. The camera stops mid-way and content ends up under a header or sheet.moveCameraandfitCoordinatesnow go throughapplyCameraUpdate, which tracks the animation in flight. When the insets change during it,setEdgeInsetsre-applies the animation against the new insets for its remaining time instead of re-centering. With no animation in flight, the re-center is unchanged. Instant commands (duration: 0) and static maps are unchanged.iOS is not affected: padding changes there don't cancel camera animations.
Type of Change
Test Plan
Android emulator (Pixel 10 Pro XL). Each case was checked against a plain
fitCoordinatesafterwards, which gives the correct frame.Bare example, Home screen. "Fit Markers" was temporarily changed for each case. The status line gives the camera center and zoom.
edgeInsetsprop raised by 300 in the same handler as the fit37.78000, -122.43000 (z14.0): no zoom change, markers cut off at the top. The plain fit moves to37.78438, -122.42650 (z13.6).37.78438, -122.42650 (z13.6). The plain fit doesn't move the camera.0.5toautoduring a 2 s fit37.78194, -122.42838 (z14.0): the fit stopped partway. The plain fit moves to37.78421, -122.42650 (z13.9).37.78421, -122.42650 (z13.9). The plain fit doesn't move the camera.Lugg consumer app, scheduled booking map. A temporary change raised the bottom
edgeInsetsprop by 450 in the same commit as afitCoordinatesrefit.Screenshots / Videos
Checklist