Repository navigation
fix(android): track camera interaction independently of map idle - #1
Open
Conversation
- Track overlapping gestures and animator instances through cancellation and replacement - Remove SDK listeners on detach and apply observer prop changes after attachment - Expose Android onCameraChanged with the shared MapState callback contract - Preserve steady timeout behavior and regenerate public documentation and examples - Add lifecycle and callback regression tests and repair existing Kotlin test literals
5 of 8 tasks
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.
A pulsing location puck keeps the renderer active, so
MapIdlecannot reliably clear camera interaction state. This follow-up to rnmapbox/maps#4222 completes the observer approach for issue #3805: programmatic camera changes reportfalsewhile gestures and their inertia reporttrue, independently of renderer idle.This PR targets rnmapbox#4222's source branch, so merging it incorporates commit
865b670963c3dd3004fafea6d65b83f536e0c7f6into the original PR.Changes
CameraGestureObserver.onCameraChangedand the existingMapStatecallback contract.gestures.isGestureActivereports touch gestures;gestures.isUserInteractionincludes gesture-owned camera animations.MapView.onRegionIsChangingnative behavior remains unchanged; applications migrate to the observer callback.Validation
On the Android emulator, a fixed location provider kept the pulsing puck visible. After a manual pan, the saved run recorded:
The new event remains correct while the unchanged legacy event reproduces the stale flag and the renderer never reports idle. Manual gesture frames are excluded from the programmatic measurement window. The original PR's basic observer path already avoided the idle dependency; focused lifecycle probes reproduced the overlap and cleanup defects addressed here.
Reproducer
Use the following as an example screen after the app's existing access-token setup.
CustomLocationProviderkeeps the puck visible without device GPS. Pan the map, allow recentering to run, and inspect the counters. Pulsing and recentering can be toggled independently. Temporary app startup adjustments and measurement code are excluded from the commit.Pulsing puck reproducer