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

Commit e295561e authored by Bryce Lee's avatar Bryce Lee
Browse files

Remove ambient status bar from Glanceable Hub.

This changelist removes the ambient status bar from Glanceable Hub in
favor of using the standard keyguard status bar.

Test: KeyguardStatusBarViewControllerTest
Fixes: 399687381
Flag: com.android.systemui.glanceable_hub_v2
Change-Id: I10ff51838b58b84c50093b947eaafd8f2bfbd00b
parent 277d34d5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.compose.animation.scene.observableTransitionState
import com.android.compose.animation.scene.rememberMutableSceneTransitionLayoutState
import com.android.compose.animation.scene.transitions
import com.android.compose.modifiers.thenIf
import com.android.systemui.Flags
import com.android.systemui.communal.shared.model.CommunalBackgroundType
import com.android.systemui.communal.shared.model.CommunalScenes
import com.android.systemui.communal.shared.model.CommunalTransitionKeys
@@ -104,8 +105,10 @@ val sceneTransitionsV2 = transitions {
            fade(Communal.Elements.Grid)
            fade(Communal.Elements.IndicationArea)
            fade(Communal.Elements.LockIcon)
            if (!Flags.glanceableHubV2()) {
                fade(Communal.Elements.StatusBar)
            }
        }
        timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) }
    }
}
@@ -131,8 +134,10 @@ val sceneTransitions = transitions {
            fade(Communal.Elements.Grid)
            fade(Communal.Elements.IndicationArea)
            fade(Communal.Elements.LockIcon)
            if (!Flags.glanceableHubV2()) {
                fade(Communal.Elements.StatusBar)
            }
        }
        timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) }
    }
    to(CommunalScenes.Blank, key = CommunalTransitionKeys.ToEditMode) {
+5 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import com.android.compose.animation.scene.ContentScope
import com.android.systemui.Flags
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
import com.android.systemui.communal.smartspace.SmartspaceInteractionHandler
import com.android.systemui.communal.ui.compose.section.AmbientStatusBarSection
@@ -70,9 +71,11 @@ constructor(
                content = {
                    Box(modifier = Modifier.fillMaxSize()) {
                        with(communalPopupSection) { Popup() }
                        if (!Flags.glanceableHubV2()) {
                            with(ambientStatusBarSection) {
                                AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f))
                            }
                        }
                        CommunalHub(
                            viewModel = viewModel,
                            interactionHandler = interactionHandler,
+2 −0
Original line number Diff line number Diff line
@@ -790,6 +790,7 @@ class KeyguardStatusBarViewControllerTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
    fun animateToGlanceableHub_affectsAlpha() =
        testScope.runTest {
            try {
@@ -809,6 +810,7 @@ class KeyguardStatusBarViewControllerTest : SysuiTestCase() {
        }

    @Test
    @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
    fun animateToGlanceableHub_alphaResetOnCommunalNotShowing() =
        testScope.runTest {
            try {
+10 −7
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.keyguard.CarrierTextController;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.logging.KeyguardLogger;
import com.android.systemui.Flags;
import com.android.systemui.battery.BatteryMeterViewController;
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor;
import com.android.systemui.dagger.qualifiers.Background;
@@ -475,12 +476,14 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
                UserHandle.USER_ALL);
        updateUserSwitcher();
        onThemeChanged();
        if (!Flags.glanceableHubV2()) {
            collectFlow(mView, mCommunalSceneInteractor.isCommunalVisible(), mCommunalConsumer,
                    mCoroutineDispatcher);
            collectFlow(mView, mLockscreenToHubTransitionViewModel.getStatusBarAlpha(),
                    mToGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
            collectFlow(mView, mHubToLockscreenTransitionViewModel.getStatusBarAlpha(),
                    mFromGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
        }
        if (NewStatusBarIcons.isEnabled()) {
            ComposeView batteryComposeView = new ComposeView(mContext);
            UnifiedBatteryViewBinder.bind(
@@ -645,7 +648,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
                        && !mDozing
                        && !hideForBypass
                        && !mDisableStateTracker.isDisabled()
                        && (!mCommunalShowing || mExplicitAlpha != -1)
                        && (Flags.glanceableHubV2() || (!mCommunalShowing || mExplicitAlpha != -1))
                        ? View.VISIBLE : View.INVISIBLE;

        updateViewState(newAlpha, newVisibility);