Fixed
Status Update
Comments
jo...@google.com <jo...@google.com> #2
Jelle, I wonder if setting DetectTapGesturesEnableNewDispatchingBehavior = true
makes this test pass?
je...@google.com <je...@google.com> #3
When I turn that flag on, the above test still fails.
There are a few launches in TapGesture
that don't use the flag yet, if I modify them according to that flag, the test passes.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Enable DetectTapGesturesEnableNewDispatchingBehavior by default
Expand for full commit details
Enable DetectTapGesturesEnableNewDispatchingBehavior by default
This flag was previously introduced when we did not have a reproduction case. We have since received positive user reports and are adding a test in this change.
This change also feature-flags the jobs that call the `onPress` callback, which we previously missed.
Relnote: Enabled `DetectTapGesturesEnableNewDispatchingBehavior` by default. `TapGestureDetector` APIs now use the new dispatching behavior (immediate dispatch) by default.
Fixes: 369648479
Test: Tested with test from b/369648479 using a StandardTestDispatcher; can't include test here as the testing changes aren't ready yet. Existing TapGestureDetector tests pass
Change-Id: I9f2bc726cffd87500d10962c067541d8add69b63
Files:
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
Hash: 653681695bac933e67b31c1cd3b6e1d5ad192c33
Date: Tue Nov 26 16:36:05 2024
pr...@google.com <pr...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha08
androidx.compose.foundation:foundation-android:1.8.0-alpha08
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha08
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha08
Description
When the down and the up event arrive in rapid succession, it is possible that the onPress callback is executed after the onTap callback.
It is currently not possible to reproduce this in a test, because we use an
UnconfinedTestDispatcher
. When we switch to aStandardTestDispatcher
, the following test (when added toTapGestureDetectorTest.kt
) will fail:While very difficult, I think you could reproduce it in a demo app with an incredibly short tap.