diff options
| author | 2018-01-08 07:33:19 +0000 | |
|---|---|---|
| committer | 2018-01-08 07:33:19 +0000 | |
| commit | 3ce996f288f9dff7304fd9d1b89255900ca2cfd9 (patch) | |
| tree | 547b8a0133517379be9bb222cd8eb938ca234840 | |
| parent | b3c096d9b52acf8951d5ece7a9652cc43f31c722 (diff) | |
| parent | f78c540cb136991dd4301f3742409f81da20eb2c (diff) | |
Merge "Parameter to hide bottom affordances"
3 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index b5abb4576147..b33f857a80bf 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -76,8 +76,11 @@ <!-- Vibration duration for GlowPadView used in SearchPanelView --> <integer translatable="false" name="config_search_panel_view_vibration_duration">20</integer> + <!-- Show mic or phone affordance on Keyguard --> + <bool name="config_keyguardShowLeftAffordance">false</bool> + <!-- Show camera affordance on Keyguard --> - <bool name="config_keyguardShowCameraAffordance">true</bool> + <bool name="config_keyguardShowCameraAffordance">false</bool> <!-- Whether we should use SRC drawing mode when drawing the scrim behind. If this flag is set, we change the canvas opacity so libhwui doesn't call glClear on our surface, and then we diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java index df1ffdaf3d87..46d982768179 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java @@ -529,6 +529,13 @@ public class KeyguardAffordanceHelper { KeyguardAffordanceView targetView = left ? mLeftIcon : mRightIcon; KeyguardAffordanceView otherView = left ? mRightIcon : mLeftIcon; startSwiping(targetView); + + // Do not animate the circle expanding if the affordance isn't visible, + // otherwise the circle will be meaningless. + if (targetView.getVisibility() != View.VISIBLE) { + animate = false; + } + if (animate) { fling(0, false, !left); updateIcon(otherView, 0.0f, 0, true, false, true, false); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index f0588626e79d..01b3b442f2b6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -822,8 +822,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL @Override public IconState getIcon() { mLeftIsVoiceAssist = canLaunchVoiceAssist(); + final boolean showAffordance = + getResources().getBoolean(R.bool.config_keyguardShowLeftAffordance); if (mLeftIsVoiceAssist) { - mIconState.isVisible = mUserSetupComplete; + mIconState.isVisible = mUserSetupComplete && showAffordance; if (mLeftAssistIcon == null) { mIconState.drawable = mContext.getDrawable(R.drawable.ic_mic_26dp); } else { @@ -832,7 +834,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mIconState.contentDescription = mContext.getString( R.string.accessibility_voice_assist_button); } else { - mIconState.isVisible = mUserSetupComplete && isPhoneVisible(); + mIconState.isVisible = mUserSetupComplete && showAffordance && isPhoneVisible(); mIconState.drawable = mContext.getDrawable(R.drawable.ic_phone_24dp); mIconState.contentDescription = mContext.getString( R.string.accessibility_phone_button); |