diff options
| author | 2025-03-13 08:17:15 -0700 | |
|---|---|---|
| committer | 2025-03-13 08:17:15 -0700 | |
| commit | fc61d012cd75b766aa156cab75bf2f00237bc268 (patch) | |
| tree | d112edc4118d48ad323df004335bea22f64caa3c | |
| parent | a419dd62d29c82d47d569614796f56cd733da64d (diff) | |
| parent | e295561e2c7f68dec2e1abbd5831cd716b57280c (diff) | |
Merge "Remove ambient status bar from Glanceable Hub." into main
4 files changed, 24 insertions, 11 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt index 3150e94908cd..2b8fe39c4870 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt @@ -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,7 +105,9 @@ val sceneTransitionsV2 = transitions { fade(Communal.Elements.Grid) fade(Communal.Elements.IndicationArea) fade(Communal.Elements.LockIcon) - fade(Communal.Elements.StatusBar) + if (!Flags.glanceableHubV2()) { + fade(Communal.Elements.StatusBar) + } } timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) } } @@ -131,7 +134,9 @@ val sceneTransitions = transitions { fade(Communal.Elements.Grid) fade(Communal.Elements.IndicationArea) fade(Communal.Elements.LockIcon) - fade(Communal.Elements.StatusBar) + if (!Flags.glanceableHubV2()) { + fade(Communal.Elements.StatusBar) + } } timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) } } diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt index 2d03e2bcdd19..0181928317e1 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt @@ -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,8 +71,10 @@ constructor( content = { Box(modifier = Modifier.fillMaxSize()) { with(communalPopupSection) { Popup() } - with(ambientStatusBarSection) { - AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f)) + if (!Flags.glanceableHubV2()) { + with(ambientStatusBarSection) { + AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f)) + } } CommunalHub( viewModel = viewModel, diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt index 46430afecbb1..1f37291efbab 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt @@ -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 { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java index 36193bd87ce2..3c144625b685 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java @@ -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(); - collectFlow(mView, mCommunalSceneInteractor.isCommunalVisible(), mCommunalConsumer, - mCoroutineDispatcher); - collectFlow(mView, mLockscreenToHubTransitionViewModel.getStatusBarAlpha(), - mToGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher); - collectFlow(mView, mHubToLockscreenTransitionViewModel.getStatusBarAlpha(), - mFromGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher); + 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); |