Repository navigation
Call onAddStart / onAddEnd for filter changes and tile drawing too - #21
Merged
Merged
Conversation
The collections called onAddStart only for a list that added states, and onAddEnd when those states' tiles were handed to the map, so an app could not tell that the map was still drawing after a filter that only hid states, or while the camera moved to undrawn tiles. AddProgressTracker now counts as busy while states are coming, while the map's tilers for this kind take a list or draw tiles (LocalOverlayTileActivity, provided by MapViewBase), and for 400 ms after a hand-over: - any list starts (total 0 when it adds nothing); an empty list after an empty one still calls nothing; - drawing alone starts once it has lasted 200 ms, so a camera move over cached tiles calls nothing; - onAddEnd comes after 400 ms with nothing coming, handed over or drawn. Counting, progress and starting over are unchanged.
AddProgress.kt: keep this branch's tracker, which already releases the pending table once every state has arrived (as develop's da49d89 does), and carry over the table-sizing comment.
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.
Stacked on #20. Needs MapConductor/android-sdk-core#58. Same rules as MapConductor/js-sdk-react and MapConductor/ios-sdk-core#48.
Why
Circles,PolylinesandPolygonscalledonAddStartonly for a list that added states, andonAddEndwhen those states' tiles were handed to the map. Drawing the tiles comes after that, so an app could not show that the map was still drawing after a carrier toggle or a zoom.New rules
onAddStart(total): every list hand-over starts.totalis 0 when the list only removes or updates states. An empty list after an empty one calls nothing.onAddStart(0)once it has lasted 200 ms, so a move over drawn tiles calls nothing.onAddEnd(total): after 400 ms with nothing coming, handed over or drawn.onAddProgress(total, total)comes just before it whentotal> 0.For apps this means a filter that only hides states now calls start and end too, and every end comes at least 400 ms later than before. No public API change.
What
AddProgressTrackerrewritten withdrawingChanged;rememberAddProgressfollows the tilers'activeflows.LocalOverlayTileActivityhands the collectionsoverlayTileActivity(kind).MapViewBaseprovides it; the default is empty, so composables without a controller (and unit tests) still work.AddProgressTrackerTestrewritten (11 tests). 23 tests pass,apiCheckpasses.Providers that provide their own composition locals (MapTiler, Longdo) do not get the drawing signal yet; hand-overs still start and end there.
Checked (antenna sample, Pixel 5a)