diff options
author | Matthias Yzusqui <myzb.dev@gmail.com> | 2016-08-02 18:58:43 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-08-26 10:08:30 -0700 |
commit | 4be68cd360d02e1bc31545a147a761b0d921e9e0 (patch) | |
tree | 115844d19e3302762b9814ac89b3315bde9092d2 /packages/SystemUI | |
parent | db7e3897056d7f089b59d8098b84a6ea29e6d644 (diff) | |
download | frameworks_base-4be68cd360d02e1bc31545a147a761b0d921e9e0.zip frameworks_base-4be68cd360d02e1bc31545a147a761b0d921e9e0.tar.gz frameworks_base-4be68cd360d02e1bc31545a147a761b0d921e9e0.tar.bz2 |
SystemUI: Don't pad when config_showScreenOnLockScreenHints is false
When the overlay is false the 'down' indicator is unused and there-
fore no padding for text alignment is needed.
Also use the overlay to disable the up-arrow indicator, thus return-
ing to the old lockscreen layout.
Change-Id: I542109686778e081c1883885287de0d5380578a2
Diffstat (limited to 'packages/SystemUI')
3 files changed, 9 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index faf60f5..e4a0196 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -76,6 +76,7 @@ public class KeyguardIndicationController { private int mChargingCurrent; private String mMessageToShowOnScreenOn; private IndicationDirection mIndicationDirection; + private boolean mScreenOnHintsEnabled; public KeyguardIndicationController(Context context, KeyguardIndicationTextView textView, LockIcon lockIcon) { @@ -87,6 +88,7 @@ public class KeyguardIndicationController { Resources res = context.getResources(); mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold); mFastThreshold = res.getInteger(R.integer.config_chargingFastThreshold); + mScreenOnHintsEnabled = res.getBoolean(R.bool.config_showScreenOnLockScreenHints); mBatteryInfo = IBatteryStats.Stub.asInterface( @@ -189,8 +191,9 @@ public class KeyguardIndicationController { final int color = computeColor(); mTextView.switchIndication(computeIndication()); mTextView.setTextColor(color); - // pad the bottom using ic_empty_space to keep text vertically aligned - int top = 0, bottom = R.drawable.ic_empty_space, left = 0, right = 0; + int top = 0, left = 0, right = 0; + // pad the bottom using ic_empty_space to keep text vertically aligned if needed + int bottom = mScreenOnHintsEnabled ? R.drawable.ic_empty_space : 0; switch (mIndicationDirection) { case UP: top = R.drawable.ic_keyboard_arrow_up; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index ef4aedb..e4e02a7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -3071,7 +3071,7 @@ public class NotificationPanelView extends PanelView implements return getSharedPreferenceBoolean(KEY_USER_RETURNED_FROM_LLS, false); } - private boolean shouldShowScreenOnHints() { + public boolean shouldShowScreenOnHints() { return mScreenOnHintsEnabled && mStatusBar.isDeviceProvisioned() && mStatusBarState == StatusBarState.KEYGUARD; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 8f06328..7df8346 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -4796,7 +4796,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public void onUnlockHintStarted() { mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock, - KeyguardIndicationController.IndicationDirection.UP); + mNotificationPanel.shouldShowScreenOnHints() ? + KeyguardIndicationController.IndicationDirection.UP : + KeyguardIndicationController.IndicationDirection.NONE); } public void onLlsHintStarted() { |