Repository navigation
fix(android): keep markers when zIndex reorders them - #111
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 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, custom-view markers moved by Reanimated disappeared, and then flickered, whenever their
zIndexchanged their draw order.Fabric moves a reordered child by removing it from the map view and inserting it again. The removal took the Google marker off the map:
The example's Reanimated fleet shows both, because each truck's
zIndexfollows its latitude. Path motion doesn't changezIndex, so it was not affected.Fixes:
LuggMapViewwaits one loop before it removes a child's map object. If Fabric inserts the same view again first, the removal is cancelled, and the marker, its icon and its position are not touched. This also covers polylines, polygons, circles and the other overlays. Children that are really removed are still removed on the next loop.syncMarkerViewadds a marker back when a custom view that has already been laid out is inserted again in a later batch. Custom views still wait for their first layout.Type of Change
Test Plan
Android emulator (Pixel 10 Pro XL), Release build of the bare example: Motion: Reanimated, Fleet (10) and Fleet (50).
removeMarkerViewcalls for markers that were still mounted, with no add after them.Screenshots / Videos
Checklist