Custom Lockscreen Shortcut preview reflects whether a shortcut is activated
Disable the activated state while in preview mode. Bug: b/269617901 Test: manual; toggle on a shortcut, go to the picker, observe proper colors/UI Test: KeyguardBottomAreaViewModelTest.kt updated to handle new behavior Change-Id: I084ed4deae605a36c86304e921c9665d72ac0d50
This commit is contained in:
@@ -187,6 +187,7 @@ constructor(
|
||||
previewMode.isInPreviewMode &&
|
||||
previewMode.shouldHighlightSelectedAffordance &&
|
||||
!isSelected,
|
||||
forceInactive = previewMode.isInPreviewMode
|
||||
)
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
@@ -198,6 +199,7 @@ constructor(
|
||||
isClickable: Boolean,
|
||||
isSelected: Boolean,
|
||||
isDimmed: Boolean,
|
||||
forceInactive: Boolean,
|
||||
): KeyguardQuickAffordanceViewModel {
|
||||
return when (this) {
|
||||
is KeyguardQuickAffordanceModel.Visible ->
|
||||
@@ -213,7 +215,7 @@ constructor(
|
||||
)
|
||||
},
|
||||
isClickable = isClickable,
|
||||
isActivated = activationState is ActivationState.Active,
|
||||
isActivated = !forceInactive && activationState is ActivationState.Active,
|
||||
isSelected = isSelected,
|
||||
useLongPress = quickAffordanceInteractor.useLongPress,
|
||||
isDimmed = isDimmed,
|
||||
|
||||
@@ -308,7 +308,7 @@ class KeyguardBottomAreaViewModelTest : SysuiTestCase() {
|
||||
TestConfig(
|
||||
isVisible = true,
|
||||
isClickable = false,
|
||||
isActivated = true,
|
||||
isActivated = false,
|
||||
icon = icon,
|
||||
canShowWhileLocked = false,
|
||||
intent = Intent("action"),
|
||||
@@ -363,7 +363,7 @@ class KeyguardBottomAreaViewModelTest : SysuiTestCase() {
|
||||
TestConfig(
|
||||
isVisible = true,
|
||||
isClickable = false,
|
||||
isActivated = true,
|
||||
isActivated = false,
|
||||
icon = icon,
|
||||
canShowWhileLocked = false,
|
||||
intent = Intent("action"),
|
||||
|
||||
Reference in New Issue
Block a user