Loading packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +5 −1 Original line number Diff line number Diff line Loading @@ -46,10 +46,12 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.blur import androidx.compose.ui.graphics.CompositingStrategy import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.layoutId import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.dp Loading Loading @@ -152,13 +154,15 @@ constructor( rememberViewModel("ShadeScene-notifPlaceholderViewModel") { notificationsPlaceholderViewModelFactory.create() } val isShadeBlurred = viewModel.isShadeBlurred val shadeBlurRadius = with(LocalDensity.current) { viewModel.shadeBlurRadius.toDp() } ShadeScene( notificationStackScrollView.get(), viewModel = viewModel, headerViewModel = headerViewModel, notificationsPlaceholderViewModel = notificationsPlaceholderViewModel, jankMonitor = jankMonitor, modifier = modifier, modifier = modifier.thenIf(isShadeBlurred) { Modifier.blur(shadeBlurRadius) }, shadeSession = shadeSession, ) } Loading packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneContentViewModel.kt +13 −0 Original line number Diff line number Diff line Loading @@ -18,11 +18,14 @@ package com.android.systemui.shade.ui.viewmodel import androidx.annotation.FloatRange import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableFloatStateOf import androidx.lifecycle.LifecycleOwner import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.ui.transitions.BlurConfig import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.lifecycle.Hydrator import com.android.systemui.media.controls.domain.pipeline.interactor.MediaCarouselInteractor Loading Loading @@ -75,6 +78,8 @@ constructor( disableFlagsInteractor: DisableFlagsInteractor, private val footerActionsViewModelFactory: FooterActionsViewModel.Factory, private val footerActionsController: FooterActionsController, keyguardInteractor: KeyguardInteractor, blurConfig: BlurConfig, unfoldTransitionInteractor: UnfoldTransitionInteractor, deviceEntryInteractor: DeviceEntryInteractor, private val sceneInteractor: SceneInteractor, Loading Loading @@ -103,6 +108,14 @@ constructor( val shadeMode: ShadeMode by hydrator.hydratedStateOf(traceName = "shadeMode", source = shadeModeInteractor.shadeMode) val isShadeBlurred: Boolean by hydrator.hydratedStateOf( traceName = "isShadeBlurred", source = keyguardInteractor.primaryBouncerShowing, ) val shadeBlurRadius: Float by mutableFloatStateOf(blurConfig.maxBlurRadiusPx) /** Whether clicking on the empty area of the shade should do something. */ val isEmptySpaceClickable: Boolean by hydrator.hydratedStateOf( Loading packages/SystemUI/tests/utils/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneContentViewModelKosmos.kt +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.shade.ui.viewmodel import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.ui.transitions.blurConfig import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.kosmos.testDispatcher Loading Loading @@ -52,6 +54,8 @@ val Kosmos.shadeSceneContentViewModel: ShadeSceneContentViewModel by Fixture { mediaViewModelFactory = mediaViewModelFactory, windowRootViewBlurInteractor = windowRootViewBlurInteractor, mediaInRowInLandscapeViewModelFactory = mediaInRowInLandscapeViewModelFactory, keyguardInteractor = keyguardInteractor, blurConfig = blurConfig, ) } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +5 −1 Original line number Diff line number Diff line Loading @@ -46,10 +46,12 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.blur import androidx.compose.ui.graphics.CompositingStrategy import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.layoutId import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.dp Loading Loading @@ -152,13 +154,15 @@ constructor( rememberViewModel("ShadeScene-notifPlaceholderViewModel") { notificationsPlaceholderViewModelFactory.create() } val isShadeBlurred = viewModel.isShadeBlurred val shadeBlurRadius = with(LocalDensity.current) { viewModel.shadeBlurRadius.toDp() } ShadeScene( notificationStackScrollView.get(), viewModel = viewModel, headerViewModel = headerViewModel, notificationsPlaceholderViewModel = notificationsPlaceholderViewModel, jankMonitor = jankMonitor, modifier = modifier, modifier = modifier.thenIf(isShadeBlurred) { Modifier.blur(shadeBlurRadius) }, shadeSession = shadeSession, ) } Loading
packages/SystemUI/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneContentViewModel.kt +13 −0 Original line number Diff line number Diff line Loading @@ -18,11 +18,14 @@ package com.android.systemui.shade.ui.viewmodel import androidx.annotation.FloatRange import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableFloatStateOf import androidx.lifecycle.LifecycleOwner import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.ui.transitions.BlurConfig import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.lifecycle.Hydrator import com.android.systemui.media.controls.domain.pipeline.interactor.MediaCarouselInteractor Loading Loading @@ -75,6 +78,8 @@ constructor( disableFlagsInteractor: DisableFlagsInteractor, private val footerActionsViewModelFactory: FooterActionsViewModel.Factory, private val footerActionsController: FooterActionsController, keyguardInteractor: KeyguardInteractor, blurConfig: BlurConfig, unfoldTransitionInteractor: UnfoldTransitionInteractor, deviceEntryInteractor: DeviceEntryInteractor, private val sceneInteractor: SceneInteractor, Loading Loading @@ -103,6 +108,14 @@ constructor( val shadeMode: ShadeMode by hydrator.hydratedStateOf(traceName = "shadeMode", source = shadeModeInteractor.shadeMode) val isShadeBlurred: Boolean by hydrator.hydratedStateOf( traceName = "isShadeBlurred", source = keyguardInteractor.primaryBouncerShowing, ) val shadeBlurRadius: Float by mutableFloatStateOf(blurConfig.maxBlurRadiusPx) /** Whether clicking on the empty area of the shade should do something. */ val isEmptySpaceClickable: Boolean by hydrator.hydratedStateOf( Loading
packages/SystemUI/tests/utils/src/com/android/systemui/shade/ui/viewmodel/ShadeSceneContentViewModelKosmos.kt +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.shade.ui.viewmodel import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.keyguard.domain.interactor.keyguardInteractor import com.android.systemui.keyguard.ui.transitions.blurConfig import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.kosmos.testDispatcher Loading Loading @@ -52,6 +54,8 @@ val Kosmos.shadeSceneContentViewModel: ShadeSceneContentViewModel by Fixture { mediaViewModelFactory = mediaViewModelFactory, windowRootViewBlurInteractor = windowRootViewBlurInteractor, mediaInRowInLandscapeViewModelFactory = mediaInRowInLandscapeViewModelFactory, keyguardInteractor = keyguardInteractor, blurConfig = blurConfig, ) } Loading