Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9322474e authored by Chandru S's avatar Chandru S Committed by Android (Google) Code Review
Browse files

Merge "Blur notification shade when bouncer is open" into main

parents fe6783b8 aad59b51
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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
@@ -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,
        )
    }
+13 −0
Original line number Diff line number Diff line
@@ -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
@@ -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,
@@ -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(
+4 −0
Original line number Diff line number Diff line
@@ -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
@@ -52,6 +54,8 @@ val Kosmos.shadeSceneContentViewModel: ShadeSceneContentViewModel by Fixture {
        mediaViewModelFactory = mediaViewModelFactory,
        windowRootViewBlurInteractor = windowRootViewBlurInteractor,
        mediaInRowInLandscapeViewModelFactory = mediaInRowInLandscapeViewModelFactory,
        keyguardInteractor = keyguardInteractor,
        blurConfig = blurConfig,
    )
}