Loading packages/SystemUI/compose/core/src/com/android/systemui/compose/animation/Expandable.kt +3 −4 Original line number Diff line number Diff line Loading @@ -53,8 +53,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.Density import androidx.lifecycle.ViewTreeLifecycleOwner import androidx.lifecycle.ViewTreeViewModelStoreOwner import androidx.savedstate.findViewTreeSavedStateRegistryOwner import androidx.savedstate.setViewTreeSavedStateRegistryOwner import com.android.systemui.animation.LaunchAnimator import kotlin.math.min Loading Loading @@ -298,8 +296,9 @@ private fun AnimatedContentInOverlay( overlayViewGroup, ViewTreeViewModelStoreOwner.get(composeViewRoot), ) overlayViewGroup.setViewTreeSavedStateRegistryOwner( composeViewRoot.findViewTreeSavedStateRegistryOwner() ViewTreeSavedStateRegistryOwner.set( overlayViewGroup, ViewTreeSavedStateRegistryOwner.get(composeViewRoot), ) composeView.setParentCompositionContext(compositionContext) Loading packages/SystemUI/compose/core/src/com/android/systemui/compose/animation/ViewTreeSavedStateRegistryOwner.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.compose.animation import android.view.View import androidx.savedstate.SavedStateRegistryOwner import androidx.savedstate.findViewTreeSavedStateRegistryOwner import androidx.savedstate.setViewTreeSavedStateRegistryOwner // TODO(b/262222023): Remove this workaround and import the new savedstate libraries in tm-qpr-dev // instead. object ViewTreeSavedStateRegistryOwner { fun set(view: View, owner: SavedStateRegistryOwner?) { view.setViewTreeSavedStateRegistryOwner(owner) } fun get(view: View): SavedStateRegistryOwner? { return view.findViewTreeSavedStateRegistryOwner() } } Loading
packages/SystemUI/compose/core/src/com/android/systemui/compose/animation/Expandable.kt +3 −4 Original line number Diff line number Diff line Loading @@ -53,8 +53,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.Density import androidx.lifecycle.ViewTreeLifecycleOwner import androidx.lifecycle.ViewTreeViewModelStoreOwner import androidx.savedstate.findViewTreeSavedStateRegistryOwner import androidx.savedstate.setViewTreeSavedStateRegistryOwner import com.android.systemui.animation.LaunchAnimator import kotlin.math.min Loading Loading @@ -298,8 +296,9 @@ private fun AnimatedContentInOverlay( overlayViewGroup, ViewTreeViewModelStoreOwner.get(composeViewRoot), ) overlayViewGroup.setViewTreeSavedStateRegistryOwner( composeViewRoot.findViewTreeSavedStateRegistryOwner() ViewTreeSavedStateRegistryOwner.set( overlayViewGroup, ViewTreeSavedStateRegistryOwner.get(composeViewRoot), ) composeView.setParentCompositionContext(compositionContext) Loading
packages/SystemUI/compose/core/src/com/android/systemui/compose/animation/ViewTreeSavedStateRegistryOwner.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.compose.animation import android.view.View import androidx.savedstate.SavedStateRegistryOwner import androidx.savedstate.findViewTreeSavedStateRegistryOwner import androidx.savedstate.setViewTreeSavedStateRegistryOwner // TODO(b/262222023): Remove this workaround and import the new savedstate libraries in tm-qpr-dev // instead. object ViewTreeSavedStateRegistryOwner { fun set(view: View, owner: SavedStateRegistryOwner?) { view.setViewTreeSavedStateRegistryOwner(owner) } fun get(view: View): SavedStateRegistryOwner? { return view.findViewTreeSavedStateRegistryOwner() } }