forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## PR scope changed The velocity calculation formula is a separate issue now, it will take all iOS platform specific datapoints into account, so no input data correction is needed. Duplicating data points will be fixed in #752. ## Proposed Changes 1. Refactor touch sending on iOS, throw SkikoPointerEvent out as redundant 2. Send coalesced touches(higher than display refresh rate touches) as historical data (don't send them for synthetics). Users can retrieve it now and use in case they need accurate touches data. 3. ~Adjust velocity calculator to filter duplicated data points in a single timestamp (because synthetic touches), leading to inadequate velocity (unexpected scrolls to top)~ 4. ~Override position reported in the `ended` phase with last known position of the touch. Solves two problems~: 4.1. ~Current velocity calculator plays bad with that value, because it's slightly exaggerated to help UIKit with proper fling calculation (opaque implementation detail) and since iOS can report two events in the same frame (`moved` and `ended` with exaggerated position with small timestamp delta, it causes awkward unexpected motions in the end of scroll which was not supposed to lead to a fling)~ 4.2. ~Delta in `ended` phase is not taken into consideration when scrolling UIScrollView (proved by reverse engineering). Passing that metadata in call tree of Draggable implementation will require internal common API changes.~ ## Testing Test: N/A ## Issues Fixed Fixes: [inadequate fling velocity during "quick-drag-and-stop" touch events sequence](JetBrains/compose-multiplatform#3335). ~Awkward motion caused by `ended` delta in the end of the drag without a fling~. ## API Change `ComposeScene.Pointer` now has a new constructor argument `val historical: List<HistoricalChange> = emptyList()` ## Video ~https://github.com/JetBrains/compose-multiplatform-core/assets/4167681/bd5f530f-d26e-4a65-ab54-8085b22b5e1d~ --------- Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com>
- Loading branch information
1 parent
95de7ad
commit 3a95834
Showing
6 changed files
with
82 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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