Fix Android issue with isUserInteraction always returning true when location puck is pulsing#4222
Open
KijongHan wants to merge 3 commits into
Conversation
… gestures being tracked that could lead to race conditions
…t map steady event detection is decoupled and can be minimally reused from RNMBXMapView
…ent kotlin components - refactor MapSteadyDetector so that it uses enum instead of magic strings
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.
Description
Fixes #3805
Fixes Android bug where
onRegionIsChanging'sproperties.isUserInteractionwas stucktruewhenever<LocationPuck pulsing="default" />was mounted, even if there were no user action. Root cause: the LocationComponent's pulsing animator keeps the map perpetually non-idle (as reported here), so Mapbox'sMapIdleevent never fires.This means that
CameraChangeTrackernever cleared user gesture state asaddOnMapIdleListenernever fired if that<LocationPuck />component was mounted. Fix was to use the new customMapSteadyevent already introduced here #4074Changes
CameraChangeTrackerand replace singlereason: CameraChangeReasonfield withreasonByGesture: Map<MapGestureType, CameraChangeReason>so concurrent move/scale/rotate gestures don't cause race conditions.MapSteadyDetectorfromRNMBXCameraGestureObserverand use this custom event fromRNMBXMapViewto drive clearing theCameraChangeTrackerstate which corrects the downstream propagation toproperties.isUserInteractionMapGestureTypeis promoted to shared enumChecklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Component to reproduce the issue you're fixing
Just pasting the same repro code snippet provided by the original issue