Status Update
Comments
ak...@gmail.com <ak...@gmail.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
il...@google.com <il...@google.com>
[Deleted User] <[Deleted User]> #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!
or...@gmail.com <or...@gmail.com> #5
ne...@gmail.com <ne...@gmail.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
di...@gmail.com <di...@gmail.com> #7
Any suggestions or workarounds yet?
jf...@3rdeyecam.com <jf...@3rdeyecam.com> #8
#6, I'd recommend opening a new bug report.
#7, are you sure that it's a bug? If so, create a minimal example and open a new bug report. If not, post to Stack Overflow and get some feedback.
For what it's worth, I was affected by this bug and it was fixed for me in alpha04.
Description
Version used: 1.0.0-alpha02
Devices/Android versions reproduced on: APIs 25-27 (only tested these; probably reproducible on more)
When navigating via an action in a subgraph, then popping the backstack, and then attempting to navigate via the same action as before, a crash is experienced with the below exception. The same navigation flow worked in 1.0.0-alpha01.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.test, PID: 29240
java.lang.IllegalArgumentException: navigation destination com.test.test:id/action_secondFragment_to_thirdFragment is unknown to this NavController
at androidx.navigation.NavController.navigate(NavController.java:633)
at androidx.navigation.NavController.navigate(NavController.java:592)
at androidx.navigation.NavController.navigate(NavController.java:580)
at com.test.test.SecondFragment$onViewCreated$1.onClick(SecondFragment.kt:17)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22429)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
I've created a sample app to demonstrate the crash:
I think this could be a duplicate of