Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit dc418d3878683fd5455ebb30c64b4a1eab9e2968
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 10 20:34:53 2021
Make draggable to contain single awaitPointerInputScope call and rewrite the events handling to coroutie channel
To elliminate the problem where we skip the events and potentially can skip the up or cancel event, causing drag to hang, we need to rewrite the draggable implementation to the channel handling
This CL does that alongside the refactoring needed to accommodate changes
Bug: 182397793
Fixes: 180030424
Test: DraggableTest, ScrollableTest, Lazy tests
Change-Id: I0e6bc0a5bd36288c4cae0efb97cc27663965cf60
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/DraggableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
https://android-review.googlesource.com/1626564
Branch: androidx-main
commit dc418d3878683fd5455ebb30c64b4a1eab9e2968
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 10 20:34:53 2021
Make draggable to contain single awaitPointerInputScope call and rewrite the events handling to coroutie channel
To elliminate the problem where we skip the events and potentially can skip the up or cancel event, causing drag to hang, we need to rewrite the draggable implementation to the channel handling
This CL does that alongside the refactoring needed to accommodate changes
Bug: 182397793
Fixes: 180030424
Test: DraggableTest, ScrollableTest, Lazy tests
Change-Id: I0e6bc0a5bd36288c4cae0efb97cc27663965cf60
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/DraggableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 7e357184de59db6318f3da00dc8942e48e0474d9
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 17 18:30:14 2021
Migrate detectTapGesutres to the single awaitPointerEventScope call.
Migrated detectTapGestures to the channel producer/consumer behaviour so there are no missed events anymore.
For general clickable without longpress or doubleclick I've made a separate implementation that has a shortcut and doesn't involve the channels or any other overhead.
Bug: 182397793
Bug: 179988949
Fixes: 179239764
Test: existing passes + added new ones for the shortcut logic
Change-Id: Ic59034552b5ef1bc972da8e3124ee5da0e8bc04e
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ClickableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Toggleable.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
M development/build_log_simplifier/messages.ignore
https://android-review.googlesource.com/1643124
Branch: androidx-main
commit 7e357184de59db6318f3da00dc8942e48e0474d9
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 17 18:30:14 2021
Migrate detectTapGesutres to the single awaitPointerEventScope call.
Migrated detectTapGestures to the channel producer/consumer behaviour so there are no missed events anymore.
For general clickable without longpress or doubleclick I've made a separate implementation that has a shortcut and doesn't involve the channels or any other overhead.
Bug: 182397793
Bug: 179988949
Fixes: 179239764
Test: existing passes + added new ones for the shortcut logic
Change-Id: Ic59034552b5ef1bc972da8e3124ee5da0e8bc04e
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ClickableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Toggleable.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
M development/build_log_simplifier/messages.ignore
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 0261205e8e5e63ca0a84fd2e9be43fe79e85591e
Author: George Mount <mount@google.com>
Date: Wed Aug 11 17:00:49 2021
Add withTimeout() and withTimeoutOrNull() to AwaitPointerEventScope
Bug: 179239764
Bug: 182397793
withTimeout() and withTimeoutOrNull() are useful functions
when working with gesture detectors that have time involved
like long press and double click. Since those two methods
are not available within AwaitPointerEventScope, the
gesture detectors exit the pointer event loop after the
withTimeout() block. This means that many gesture detectors
were having trouble with losing pointer events.
A previous change fixed this by using two independent
jobs, one that manages the pointer event loop and sends
the events through a channel, and the other reads the
channel and can use withTimeout().
This change adds withTimeout() and withTimeoutOrNull()
to AwaitPointerEventScope so that gesture detectors
can manage pointer events with timed events without
leaving the event loop.
detectTapGestures() was modified to use the new
mechanism.
Relnote: "AwaitPointerEventScope now has withTimeout()
and withTimeoutOrNull()"
Test: new tests for withTimeout() and withTimeoutOrNull()
Test: ran existing tests for detectTapGestures()
Change-Id: I507f0e696311ac0504126681c376f73beaa021fb
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
https://android-review.googlesource.com/1794927
Branch: androidx-main
commit 0261205e8e5e63ca0a84fd2e9be43fe79e85591e
Author: George Mount <mount@google.com>
Date: Wed Aug 11 17:00:49 2021
Add withTimeout() and withTimeoutOrNull() to AwaitPointerEventScope
Bug: 179239764
Bug: 182397793
withTimeout() and withTimeoutOrNull() are useful functions
when working with gesture detectors that have time involved
like long press and double click. Since those two methods
are not available within AwaitPointerEventScope, the
gesture detectors exit the pointer event loop after the
withTimeout() block. This means that many gesture detectors
were having trouble with losing pointer events.
A previous change fixed this by using two independent
jobs, one that manages the pointer event loop and sends
the events through a channel, and the other reads the
channel and can use withTimeout().
This change adds withTimeout() and withTimeoutOrNull()
to AwaitPointerEventScope so that gesture detectors
can manage pointer events with timed events without
leaving the event loop.
detectTapGestures() was modified to use the new
mechanism.
Relnote: "AwaitPointerEventScope now has withTimeout()
and withTimeoutOrNull()"
Test: new tests for withTimeout() and withTimeoutOrNull()
Test: ran existing tests for detectTapGestures()
Change-Id: I507f0e696311ac0504126681c376f73beaa021fb
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
Description
Per many discussions, in order to guarantee that we don't skip any events, we have to have only one awantPointerInputScope per Modifier.pointerInput node.
This is meta ticket to eliminate all related problem in the foundational gestures.