Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,27 @@ class KeyguardRepositoryImplTest : SysuiTestCase() { assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f) } @Test fun panelAlpha() = testScope.runTest { assertThat(underTest.panelAlpha.value).isEqualTo(1f) underTest.setPanelAlpha(0.1f) assertThat(underTest.panelAlpha.value).isEqualTo(0.1f) underTest.setPanelAlpha(0.2f) assertThat(underTest.panelAlpha.value).isEqualTo(0.2f) underTest.setPanelAlpha(0.3f) assertThat(underTest.panelAlpha.value).isEqualTo(0.3f) underTest.setPanelAlpha(0.5f) assertThat(underTest.panelAlpha.value).isEqualTo(0.5f) underTest.setPanelAlpha(1.0f) assertThat(underTest.panelAlpha.value).isEqualTo(1f) } @Test fun topClippingBounds() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +11 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ interface KeyguardRepository { val keyguardAlpha: StateFlow<Float> val panelAlpha: MutableStateFlow<Float> /** * Observable for whether the keyguard is showing. * Loading Loading @@ -250,6 +252,9 @@ interface KeyguardRepository { /** Sets the current amount of alpha that should be used for rendering the keyguard. */ fun setKeyguardAlpha(alpha: Float) /** Temporary shim for fading out content when the brightness slider is used */ fun setPanelAlpha(alpha: Float) /** Whether the device is actively dreaming */ fun setDreaming(isDreaming: Boolean) Loading Loading @@ -338,6 +343,8 @@ constructor( private val _keyguardAlpha = MutableStateFlow(1f) override val keyguardAlpha = _keyguardAlpha.asStateFlow() override val panelAlpha: MutableStateFlow<Float> = MutableStateFlow(1f) private val _clockShouldBeCentered = MutableStateFlow(true) override val clockShouldBeCentered: Flow<Boolean> = _clockShouldBeCentered.asStateFlow() Loading Loading @@ -659,6 +666,10 @@ constructor( _keyguardAlpha.value = alpha } override fun setPanelAlpha(alpha: Float) { panelAlpha.value = alpha } override fun setDreaming(isDreaming: Boolean) { this.isDreaming.value = isDreaming } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +8 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,10 @@ constructor( @Deprecated("Use the relevant TransitionViewModel") val keyguardAlpha: Flow<Float> = repository.keyguardAlpha /** Temporary shim for fading out content when the brightness slider is used */ @Deprecated("SceneContainer uses NotificationStackAppearanceInteractor") val panelAlpha: StateFlow<Float> = repository.panelAlpha.asStateFlow() /** * When the lockscreen can be dismissed, emit an alpha value as the user swipes up. This is * useful just before the code commits to moving to GONE. Loading Loading @@ -458,6 +462,10 @@ constructor( repository.setKeyguardAlpha(alpha) } fun setPanelAlpha(alpha: Float) { repository.setPanelAlpha(alpha) } fun setAnimateDozingTransitions(animate: Boolean) { repository.setAnimateDozingTransitions(animate) } Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +8 −1 Original line number Diff line number Diff line Loading @@ -483,7 +483,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private float mBottomAreaShadeAlpha; final ValueAnimator mBottomAreaShadeAlphaAnimator; private final AnimatableProperty mPanelAlphaAnimator = AnimatableProperty.from("panelAlpha", NotificationPanelView::setPanelAlphaInternal, (view, alpha) -> { setAlphaInternal(alpha); }, NotificationPanelView::getCurrentPanelAlpha, R.id.panel_alpha_animator_tag, R.id.panel_alpha_animator_start_tag, R.id.panel_alpha_animator_end_tag); Loading Loading @@ -3074,6 +3076,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } } private void setAlphaInternal(float alpha) { mKeyguardInteractor.setPanelAlpha(alpha / 255f); mView.setPanelAlphaInternal(alpha); } @Override public void setAlphaChangeAnimationEndAction(Runnable r) { mPanelAlphaEndAction = r; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,6 @@ import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; import com.android.systemui.keyguard.shared.model.TransitionStep; Loading Loading @@ -1320,7 +1319,10 @@ public class NotificationStackScrollLayoutController implements Dumpable { updateAlpha(); } void setMaxAlphaFromView(float alpha) { /** * Max alpha from the containing view. Used by brightness slider as an example. */ public void setMaxAlphaFromView(float alpha) { mMaxAlphaFromView = alpha; updateAlpha(); } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,27 @@ class KeyguardRepositoryImplTest : SysuiTestCase() { assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f) } @Test fun panelAlpha() = testScope.runTest { assertThat(underTest.panelAlpha.value).isEqualTo(1f) underTest.setPanelAlpha(0.1f) assertThat(underTest.panelAlpha.value).isEqualTo(0.1f) underTest.setPanelAlpha(0.2f) assertThat(underTest.panelAlpha.value).isEqualTo(0.2f) underTest.setPanelAlpha(0.3f) assertThat(underTest.panelAlpha.value).isEqualTo(0.3f) underTest.setPanelAlpha(0.5f) assertThat(underTest.panelAlpha.value).isEqualTo(0.5f) underTest.setPanelAlpha(1.0f) assertThat(underTest.panelAlpha.value).isEqualTo(1f) } @Test fun topClippingBounds() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +11 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ interface KeyguardRepository { val keyguardAlpha: StateFlow<Float> val panelAlpha: MutableStateFlow<Float> /** * Observable for whether the keyguard is showing. * Loading Loading @@ -250,6 +252,9 @@ interface KeyguardRepository { /** Sets the current amount of alpha that should be used for rendering the keyguard. */ fun setKeyguardAlpha(alpha: Float) /** Temporary shim for fading out content when the brightness slider is used */ fun setPanelAlpha(alpha: Float) /** Whether the device is actively dreaming */ fun setDreaming(isDreaming: Boolean) Loading Loading @@ -338,6 +343,8 @@ constructor( private val _keyguardAlpha = MutableStateFlow(1f) override val keyguardAlpha = _keyguardAlpha.asStateFlow() override val panelAlpha: MutableStateFlow<Float> = MutableStateFlow(1f) private val _clockShouldBeCentered = MutableStateFlow(true) override val clockShouldBeCentered: Flow<Boolean> = _clockShouldBeCentered.asStateFlow() Loading Loading @@ -659,6 +666,10 @@ constructor( _keyguardAlpha.value = alpha } override fun setPanelAlpha(alpha: Float) { panelAlpha.value = alpha } override fun setDreaming(isDreaming: Boolean) { this.isDreaming.value = isDreaming } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +8 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,10 @@ constructor( @Deprecated("Use the relevant TransitionViewModel") val keyguardAlpha: Flow<Float> = repository.keyguardAlpha /** Temporary shim for fading out content when the brightness slider is used */ @Deprecated("SceneContainer uses NotificationStackAppearanceInteractor") val panelAlpha: StateFlow<Float> = repository.panelAlpha.asStateFlow() /** * When the lockscreen can be dismissed, emit an alpha value as the user swipes up. This is * useful just before the code commits to moving to GONE. Loading Loading @@ -458,6 +462,10 @@ constructor( repository.setKeyguardAlpha(alpha) } fun setPanelAlpha(alpha: Float) { repository.setPanelAlpha(alpha) } fun setAnimateDozingTransitions(animate: Boolean) { repository.setAnimateDozingTransitions(animate) } Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +8 −1 Original line number Diff line number Diff line Loading @@ -483,7 +483,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private float mBottomAreaShadeAlpha; final ValueAnimator mBottomAreaShadeAlphaAnimator; private final AnimatableProperty mPanelAlphaAnimator = AnimatableProperty.from("panelAlpha", NotificationPanelView::setPanelAlphaInternal, (view, alpha) -> { setAlphaInternal(alpha); }, NotificationPanelView::getCurrentPanelAlpha, R.id.panel_alpha_animator_tag, R.id.panel_alpha_animator_start_tag, R.id.panel_alpha_animator_end_tag); Loading Loading @@ -3074,6 +3076,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } } private void setAlphaInternal(float alpha) { mKeyguardInteractor.setPanelAlpha(alpha / 255f); mView.setPanelAlphaInternal(alpha); } @Override public void setAlphaChangeAnimationEndAction(Runnable r) { mPanelAlphaEndAction = r; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,6 @@ import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.MigrateClocksToBlueprint; import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository; import com.android.systemui.keyguard.shared.model.KeyguardState; import com.android.systemui.keyguard.shared.model.TransitionStep; Loading Loading @@ -1320,7 +1319,10 @@ public class NotificationStackScrollLayoutController implements Dumpable { updateAlpha(); } void setMaxAlphaFromView(float alpha) { /** * Max alpha from the containing view. Used by brightness slider as an example. */ public void setMaxAlphaFromView(float alpha) { mMaxAlphaFromView = alpha; updateAlpha(); } Loading