Fixed
Status Update
Comments
il...@google.com <il...@google.com>
sa...@google.com <sa...@google.com>
sa...@google.com <sa...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 93dc6213fe2e74aa9c9d3dcdb4551c6ad3a85ba4
Author: sanura <sanura@google.com>
Date: Thu Mar 16 01:59:33 2023
Add private initViewTreeOwners() to AppCompatDialog
Ensure that AppCompatDialog also sets initial view
tree owners, since it does not call through to
super.setContentView(), which would set them via
ComponentDialog.
RelNote: "`AppCompatDialog` now correctly sets the `LifecycleOwner`, `SavedStateRegistryOwner`, and `OnBackPressedDispatcherOwner` on the dialog's decor view via the ViewTree APIs, fixing issues when hosting a ComposeView within an AppCompatDialog. AppCompat now depends on Activity 1.7.0."
Bug: 261314581
Test: AppComptaDialogTest
Change-Id: Ib28abb12cc3c617b9ffed9e1450e48308dc7c3df
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatDialogTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
https://android-review.googlesource.com/2493316
Branch: androidx-main
commit 93dc6213fe2e74aa9c9d3dcdb4551c6ad3a85ba4
Author: sanura <sanura@google.com>
Date: Thu Mar 16 01:59:33 2023
Add private initViewTreeOwners() to AppCompatDialog
Ensure that AppCompatDialog also sets initial view
tree owners, since it does not call through to
super.setContentView(), which would set them via
ComponentDialog.
RelNote: "`AppCompatDialog` now correctly sets the `LifecycleOwner`, `SavedStateRegistryOwner`, and `OnBackPressedDispatcherOwner` on the dialog's decor view via the ViewTree APIs, fixing issues when hosting a ComposeView within an AppCompatDialog. AppCompat now depends on Activity 1.7.0."
Bug: 261314581
Test: AppComptaDialogTest
Change-Id: Ib28abb12cc3c617b9ffed9e1450e48308dc7c3df
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatDialogTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 6b7a0f963d43aa6a06b461d62743ed81adddce40
Author: sanura <sanura@google.com>
Date: Thu Mar 16 23:01:38 2023
Open up initViewTreeOwners() API for ComponentDialog and ComponentActivity
Making initViewTreeOwners() a public API in ComponentDialog
and ComponentActivity so it can be used by AppCompat.
RelNote: "`ComponentDialog` and `ComponentActivity` now
contain public API `initViewTreeOwners()` to be used to
initialize all view tree owners before setting the
content view."
Bug: 261314581
Test: all tests pass
Change-Id: Ibdce0a994b0daddc090e4ff58583ccba71612870
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
https://android-review.googlesource.com/2493317
Branch: androidx-main
commit 6b7a0f963d43aa6a06b461d62743ed81adddce40
Author: sanura <sanura@google.com>
Date: Thu Mar 16 23:01:38 2023
Open up initViewTreeOwners() API for ComponentDialog and ComponentActivity
Making initViewTreeOwners() a public API in ComponentDialog
and ComponentActivity so it can be used by AppCompat.
RelNote: "`ComponentDialog` and `ComponentActivity` now
contain public API `initViewTreeOwners()` to be used to
initialize all view tree owners before setting the
content view."
Bug: 261314581
Test: all tests pass
Change-Id: Ibdce0a994b0daddc090e4ff58583ccba71612870
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
sa...@google.com <sa...@google.com>
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Activity 1.8.0-alpha03
release.
na...@google.com <na...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.appcompat:appcompat:1.7.0-alpha03
co...@gmail.com <co...@gmail.com> #6
Coco73g11@gmail.com
Galaxy 3571881034
199001
On Wed, Mar 29, 2023, 11:36 PM <buganizer-system@google.com> wrote:
Galaxy 3571881034
199001
On Wed, Mar 29, 2023, 11:36 PM <buganizer-system@google.com> wrote:
Description
Version used: 1.5.1 (also tested on 1.7.0-alpha01)
Devices/Android versions reproduced on: Pixel 5 API 30 emulator
Description:
The linked repo or ZIP contains a reproduction of an issue with the AppCompatDialog & Componentdialog. It shows that the ComponentDialog does not set the ViewLifecycleTreeOwner correctly when setContentView is called. AppCompatDialog (the subclass of ComponentDialog) does not call super.setContentView and instead calls a delegate which never reaches ComponentDialog. When trying to access the ViewTreeLifecycleOwner of the dialog, a null pointer exception is thrown.
If this is a bug in the library, we would appreciate if you could attach:
-
- ZIP also attached