Loading packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.keyguard.ui.composable.LockscreenContent import com.android.systemui.keyguard.ui.composable.LockscreenScene import com.android.systemui.keyguard.ui.composable.LockscreenSceneBlueprintModule import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenFrontScrimViewModel import com.android.systemui.scene.ui.composable.Scene Loading Loading @@ -63,6 +64,7 @@ interface LockscreenSceneModule { viewModelFactory: LockscreenContentViewModel.Factory, notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory, lockscreenFrontScrimViewModelFactory: LockscreenFrontScrimViewModel.Factory, lockscreenBehindScrimViewModelFactory: LockscreenBehindScrimViewModel.Factory, blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>, clockInteractor: KeyguardClockInteractor, interactionJankMonitor: InteractionJankMonitor, Loading @@ -71,6 +73,7 @@ interface LockscreenSceneModule { viewModelFactory, notificationScrimViewModelFactory, lockscreenFrontScrimViewModelFactory, lockscreenBehindScrimViewModelFactory, blueprints, clockInteractor, interactionJankMonitor, Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenBehindScrim.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.keyguard.ui.composable import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel /** A full-screen scrim that is used to dim the keyguard wallpaper. */ @Composable fun LockscreenBehindScrim( viewModel: LockscreenBehindScrimViewModel, modifier: Modifier = Modifier, ) { val animatedAlpha: Float by animateFloatAsState(viewModel.alpha) Box(modifier.fillMaxSize().graphicsLayer { alpha = animatedAlpha }.background(Color.Black)) } packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.transition.KeyguardTransitionAnimationCallback import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenFrontScrimViewModel import com.android.systemui.lifecycle.rememberViewModel Loading @@ -48,6 +49,7 @@ class LockscreenContent( private val viewModelFactory: LockscreenContentViewModel.Factory, private val notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory, private val lockscreenFrontScrimViewModelFactory: LockscreenFrontScrimViewModel.Factory, private val lockscreenBehindScrimViewModelFactory: LockscreenBehindScrimViewModel.Factory, private val blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>, private val clockInteractor: KeyguardClockInteractor, private val interactionJankMonitor: InteractionJankMonitor, Loading @@ -74,9 +76,14 @@ class LockscreenContent( rememberViewModel("LockscreenContent-frontScrimViewModel") { lockscreenFrontScrimViewModelFactory.create() } val lockscreenBehindScrimViewModel = rememberViewModel("LockscreenContent-behindScrimViewModel") { lockscreenBehindScrimViewModelFactory.create() } // Ensure clock events are connected. This is a no-op if they are already registered. clockInteractor.clockEventController.registerListeners() if (!viewModel.isContentVisible) { // If the content isn't supposed to be visible, show a large empty box as it's needed // for scene transition animations (can't just skip rendering everything or shared Loading @@ -93,6 +100,10 @@ class LockscreenContent( val blueprint = blueprintByBlueprintId[viewModel.blueprintId] ?: return with(blueprint) { LockscreenBehindScrim( lockscreenBehindScrimViewModel, Modifier.element(LockscreenElementKeys.BehindScrim), ) Content( viewModel, modifier.sysuiResTag("keyguard_root_view").element(LockscreenElementKeys.Root), Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToGoneTransition.kt +2 −0 Original line number Diff line number Diff line Loading @@ -2,10 +2,12 @@ package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import com.android.compose.animation.scene.TransitionBuilder import com.android.systemui.plugins.keyguard.ui.composable.elements.LockscreenElementKeys import com.android.systemui.scene.shared.model.Scenes fun TransitionBuilder.lockscreenToGoneTransition() { spec = tween(durationMillis = 500) fade(Scenes.Lockscreen.rootElementKey) fade(LockscreenElementKeys.BehindScrim) } packages/SystemUI/plugin/src/com/android/systemui/plugins/keyguard/ui/composable/elements/LockscreenElementKeys.kt +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.android.compose.animation.scene.ElementKey object LockscreenElementKeys { /** Root element of the entire lockcsreen */ val Root = ElementKey("LockscreenRoot") val BehindScrim = ElementKey("LockscreenBehindScrim") object Region { /** The upper region includes everything above the lock icon */ Loading Loading
packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.keyguard.ui.composable.LockscreenContent import com.android.systemui.keyguard.ui.composable.LockscreenScene import com.android.systemui.keyguard.ui.composable.LockscreenSceneBlueprintModule import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenFrontScrimViewModel import com.android.systemui.scene.ui.composable.Scene Loading Loading @@ -63,6 +64,7 @@ interface LockscreenSceneModule { viewModelFactory: LockscreenContentViewModel.Factory, notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory, lockscreenFrontScrimViewModelFactory: LockscreenFrontScrimViewModel.Factory, lockscreenBehindScrimViewModelFactory: LockscreenBehindScrimViewModel.Factory, blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>, clockInteractor: KeyguardClockInteractor, interactionJankMonitor: InteractionJankMonitor, Loading @@ -71,6 +73,7 @@ interface LockscreenSceneModule { viewModelFactory, notificationScrimViewModelFactory, lockscreenFrontScrimViewModelFactory, lockscreenBehindScrimViewModelFactory, blueprints, clockInteractor, interactionJankMonitor, Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenBehindScrim.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.keyguard.ui.composable import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel /** A full-screen scrim that is used to dim the keyguard wallpaper. */ @Composable fun LockscreenBehindScrim( viewModel: LockscreenBehindScrimViewModel, modifier: Modifier = Modifier, ) { val animatedAlpha: Float by animateFloatAsState(viewModel.alpha) Box(modifier.fillMaxSize().graphicsLayer { alpha = animatedAlpha }.background(Color.Black)) }
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.transition.KeyguardTransitionAnimationCallback import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenBehindScrimViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenFrontScrimViewModel import com.android.systemui.lifecycle.rememberViewModel Loading @@ -48,6 +49,7 @@ class LockscreenContent( private val viewModelFactory: LockscreenContentViewModel.Factory, private val notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory, private val lockscreenFrontScrimViewModelFactory: LockscreenFrontScrimViewModel.Factory, private val lockscreenBehindScrimViewModelFactory: LockscreenBehindScrimViewModel.Factory, private val blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>, private val clockInteractor: KeyguardClockInteractor, private val interactionJankMonitor: InteractionJankMonitor, Loading @@ -74,9 +76,14 @@ class LockscreenContent( rememberViewModel("LockscreenContent-frontScrimViewModel") { lockscreenFrontScrimViewModelFactory.create() } val lockscreenBehindScrimViewModel = rememberViewModel("LockscreenContent-behindScrimViewModel") { lockscreenBehindScrimViewModelFactory.create() } // Ensure clock events are connected. This is a no-op if they are already registered. clockInteractor.clockEventController.registerListeners() if (!viewModel.isContentVisible) { // If the content isn't supposed to be visible, show a large empty box as it's needed // for scene transition animations (can't just skip rendering everything or shared Loading @@ -93,6 +100,10 @@ class LockscreenContent( val blueprint = blueprintByBlueprintId[viewModel.blueprintId] ?: return with(blueprint) { LockscreenBehindScrim( lockscreenBehindScrimViewModel, Modifier.element(LockscreenElementKeys.BehindScrim), ) Content( viewModel, modifier.sysuiResTag("keyguard_root_view").element(LockscreenElementKeys.Root), Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToGoneTransition.kt +2 −0 Original line number Diff line number Diff line Loading @@ -2,10 +2,12 @@ package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import com.android.compose.animation.scene.TransitionBuilder import com.android.systemui.plugins.keyguard.ui.composable.elements.LockscreenElementKeys import com.android.systemui.scene.shared.model.Scenes fun TransitionBuilder.lockscreenToGoneTransition() { spec = tween(durationMillis = 500) fade(Scenes.Lockscreen.rootElementKey) fade(LockscreenElementKeys.BehindScrim) }
packages/SystemUI/plugin/src/com/android/systemui/plugins/keyguard/ui/composable/elements/LockscreenElementKeys.kt +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.android.compose.animation.scene.ElementKey object LockscreenElementKeys { /** Root element of the entire lockcsreen */ val Root = ElementKey("LockscreenRoot") val BehindScrim = ElementKey("LockscreenBehindScrim") object Region { /** The upper region includes everything above the lock icon */ Loading