Skip to content

fix(android): keep camera animations when edge insets change - #101

Merged
lodev09 merged 1 commit into
mainfrom
fix/android-keep-camera-animation
Oct 18, 2026
Merged

lodev09 merged 1 commit into
mainfrom
fix/android-keep-camera-animation

Conversation

@lodev09

@lodev09 lodev09 commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

On Android, an edge inset change cancels a running moveCamera or fitCoordinates animation. GoogleMapProvider.setEdgeInsets re-centers with map.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 an edgeInsets prop 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.

moveCamera and fitCoordinates now go through applyCameraUpdate, which tracks the animation in flight. When the insets change during it, setEdgeInsets re-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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

Android emulator (Pixel 10 Pro XL). Each case was checked against a plain fitCoordinates afterwards, 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.

Case 1.1.4 This branch
edgeInsets prop raised by 300 in the same handler as the fit 37.78000, -122.43000 (z14.0): no zoom change, markers cut off at the top. The plain fit moves to 37.78438, -122.42650 (z13.6). 37.78438, -122.42650 (z13.6). The plain fit doesn't move the camera.
Sheet dragged from 0.5 to auto during a 2 s fit 37.78194, -122.42838 (z14.0): the fit stopped partway. The plain fit moves to 37.78421, -122.42650 (z13.9). 37.78421, -122.42650 (z13.9). The plain fit doesn't move the camera.
Map panned during a 2 s fit, then the sheet dragged not run The pan cancels the fit and the camera stays where the pan left it. The later inset change only re-centers; the cancelled fit doesn't replay.

Lugg consumer app, scheduled booking map. A temporary change raised the bottom edgeInsets prop by 450 in the same commit as a fitCoordinates refit.

  • 1.1.4: the zoom stayed the same and the route shifted under the header. The plain fit afterwards zoomed out to the correct frame.
  • This branch: the refit lands on the correct frame. The plain fit afterwards doesn't move the camera.

Screenshots / Videos

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lugg-maps Ready Ready Preview Oct 18, 2026 5:02pm UTC

Request Review

@lodev09
lodev09 merged commit 9135fb4 into main Oct 18, 2026
5 checks passed
@lodev09
lodev09 deleted the fix/android-keep-camera-animation branch October 18, 2026 17:15

This branch was successfully deployed

1 active deployment
Preview — e64cfc76 Deployed Oct 18, 2026 by vercel[bot]
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.

1 participant