summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/compose/core/src/com/android/compose/animation/Expandable.kt17
1 files changed, 8 insertions, 9 deletions
diff --git a/packages/SystemUI/compose/core/src/com/android/compose/animation/Expandable.kt b/packages/SystemUI/compose/core/src/com/android/compose/animation/Expandable.kt
index d4a81f9c765d..ac1ef1509415 100644
--- a/packages/SystemUI/compose/core/src/com/android/compose/animation/Expandable.kt
+++ b/packages/SystemUI/compose/core/src/com/android/compose/animation/Expandable.kt
@@ -70,8 +70,10 @@ import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
-import androidx.lifecycle.ViewTreeLifecycleOwner
-import androidx.lifecycle.ViewTreeViewModelStoreOwner
+import androidx.lifecycle.findViewTreeLifecycleOwner
+import androidx.lifecycle.findViewTreeViewModelStoreOwner
+import androidx.lifecycle.setViewTreeLifecycleOwner
+import androidx.lifecycle.setViewTreeViewModelStoreOwner
import com.android.systemui.animation.Expandable
import com.android.systemui.animation.LaunchAnimator
import kotlin.math.max
@@ -368,13 +370,10 @@ private fun AnimatedContentInOverlay(
context,
overlay,
)
- ViewTreeLifecycleOwner.set(
- overlayViewGroup,
- ViewTreeLifecycleOwner.get(composeViewRoot),
- )
- ViewTreeViewModelStoreOwner.set(
- overlayViewGroup,
- ViewTreeViewModelStoreOwner.get(composeViewRoot),
+
+ overlayViewGroup.setViewTreeLifecycleOwner(composeViewRoot.findViewTreeLifecycleOwner())
+ overlayViewGroup.setViewTreeViewModelStoreOwner(
+ composeViewRoot.findViewTreeViewModelStoreOwner()
)
ViewTreeSavedStateRegistryOwner.set(
overlayViewGroup,