Fixed
Status Update
Comments
sa...@google.com <sa...@google.com>
za...@affirm.com <za...@affirm.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
sa...@google.com <sa...@google.com>
ap...@google.com <ap...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit ef85e7e7f4e5742d9668f98c15be6b214b00e6f9
Author: sanura <sanura@google.com>
Date: Wed Jan 04 00:00:32 2023
Have ComponentDialog also set ViewTreeSavedStateRegistryOwner
Now that ComponentDialog is a SavedStateRegistryOwner,
it should also set it during its ViewTree initialization.
RelNote: "`ComponentDialog` now also sets the
`SavedStateRegistryOwner` for its ViewTree."
Bug: 261162296
Test: testViewTreeSavedStateRegistryOwner
Change-Id: I7346856b333933e03f5d3b0d380f5122b4856908
M activity/activity/src/androidTest/java/androidx/activity/ComponentDialogTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
https://android-review.googlesource.com/2374989
Branch: androidx-main
commit ef85e7e7f4e5742d9668f98c15be6b214b00e6f9
Author: sanura <sanura@google.com>
Date: Wed Jan 04 00:00:32 2023
Have ComponentDialog also set ViewTreeSavedStateRegistryOwner
Now that ComponentDialog is a SavedStateRegistryOwner,
it should also set it during its ViewTree initialization.
RelNote: "`ComponentDialog` now also sets the
`SavedStateRegistryOwner` for its ViewTree."
Bug: 261162296
Test: testViewTreeSavedStateRegistryOwner
Change-Id: I7346856b333933e03f5d3b0d380f5122b4856908
M activity/activity/src/androidTest/java/androidx/activity/ComponentDialogTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
za...@affirm.com <za...@affirm.com> #5
Great to see the progress on this! Just curious, in the other bug I linked I noted that AppcompatDialog which inherits from ComponentDialog doesn't call some methods on super which would trigger this new code, instead AppcompatDialog calls some delegate methods which don't reach ComponentDialog. Will that be addressed as well?
sa...@google.com <sa...@google.com> #6
re #5: Please use the other bug (
za...@affirm.com <za...@affirm.com> #7
Ah dang I am not a google employee so can't see that bug.
sa...@google.com <sa...@google.com> #9
My apologies. Public link is
na...@google.com <na...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.activity:activity:1.7.0-alpha03
Description
Component used: Activity
Version used: 1.7.0-alpha02
It would be really convenient if
ComponentDialog
, in addition to implementingLifecycleOwner
andOnBackPressedDispatcherOwner
, would also implementSavedStateRegistryOwner
.That
SavedStateRegistryOwner
should be plugged into theDialog
class'onSaveInstanceState
andonRestoreInstanceState
.This would make it much easier to use Jetpack Compose in a
ComponentDialog
, since Jetpack Compose requires both aLifecycleOwner
and aSavedStateRegistryOwner
attached to the Window via the ViewTree APIs.