From 2f0b9d45eebf2dad43d47e20decd6af704537740 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 10 May 2023 23:04:30 +0000 Subject: [PATCH] Revert "Fix Expandable.kt to work with new Compose prebuilts" Revert submission 22208109-lifecycle_9778738 Reason for revert: Reverted changes: /q/submissionid:22208109-lifecycle_9778738 Change-Id: I003cf7a0a83135c48dc2ad3de0807a49442a3d17 --- .../com/android/compose/animation/Expandable.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 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 ac1ef15094151..d4a81f9c765d2 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,10 +70,8 @@ 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.findViewTreeLifecycleOwner -import androidx.lifecycle.findViewTreeViewModelStoreOwner -import androidx.lifecycle.setViewTreeLifecycleOwner -import androidx.lifecycle.setViewTreeViewModelStoreOwner +import androidx.lifecycle.ViewTreeLifecycleOwner +import androidx.lifecycle.ViewTreeViewModelStoreOwner import com.android.systemui.animation.Expandable import com.android.systemui.animation.LaunchAnimator import kotlin.math.max @@ -370,10 +368,13 @@ private fun AnimatedContentInOverlay( context, overlay, ) - - overlayViewGroup.setViewTreeLifecycleOwner(composeViewRoot.findViewTreeLifecycleOwner()) - overlayViewGroup.setViewTreeViewModelStoreOwner( - composeViewRoot.findViewTreeViewModelStoreOwner() + ViewTreeLifecycleOwner.set( + overlayViewGroup, + ViewTreeLifecycleOwner.get(composeViewRoot), + ) + ViewTreeViewModelStoreOwner.set( + overlayViewGroup, + ViewTreeViewModelStoreOwner.get(composeViewRoot), ) ViewTreeSavedStateRegistryOwner.set( overlayViewGroup,