Status Update
Comments
ry...@google.com <ry...@google.com>
sm...@google.com <sm...@google.com> #2
Branch: androidx-main
commit c2365dcfeb9064814282304f30f3eb86be71fdc7
Author: Dan Nizri <dniz@google.com>
Date: Wed Dec 20 16:33:08 2023
Fix Popup back handling on Android T/13+ when android:enableOnBackInvokedCallback="true"
Bug: 313702338
Bug: 318537200
Test: tested with android:enableOnBackInvokedCallback="true"
Change-Id: I7c7cef686ed9fbfd2d144c90040b13528f1675ed
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.android.kt
eq...@gmail.com <eq...@gmail.com> #3
Is there remaining work for this feature request. Support for predictive back in Dialogs would allow Material3 to remove some Dialog forks and would be very helpful!
fa...@gmail.com <fa...@gmail.com> #5
sm...@google.com <sm...@google.com> #6
(recapping my chat with Ian)
The tricky part is that the onDismissRequest
is really the final signal and a chance for the app to just say 'nope, I don't want the dialog to dismiss' (since they own the state of 'should the dialog be shown or not' simply by either adding the Dialog to composition or leaving out of composition) - that's the just-in-time problem that the comment talks about. It would be very odd to have any kind of progress animation that doesn't actually lead to the dialog being dismissed when it is committed"
so really it needs to be a more holistic look at how to do dialogs and swap from a binary state (shown/not shown) to something that actually has something in between for cases like predictive back
sm...@google.com <sm...@google.com> #7
BTW, f I didn't say it already, thank you for reporting the bug. I truly wish I had time to address this soon, but am only able to support this lib in my spare time.
Description
Version used: 1.1.0-rc01
Devices/Android versions reproduced on: OnePlus 5 / Android 9
The following steps in any app using a RecyclerView with selection support implemented via androidx.recyclerview.selection lead to the bug:
1. Long-tap any item to select it.
2. Single-tap any item to select it.
3. Very quickly after 2., single-tap the item right above the item tapped in 2. Ensure that the two taps happen very close to each other.
4. Observe that the tap in 3. does not result in a selection.
The root cause is that the off-the-shelf GestureDetector has no knowledge about items and considers two taps a double tap if they are close enough to each other (see
As a consequence, quickly selecting a row of items manually (not via drag selection) can be rather frustrating for end-users.