Skip to content

Commit 4be68cd

Browse files
Matthias YzusquiGerrit Code Review
authored andcommitted
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
1 parent db7e389 commit 4be68cd

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public class KeyguardIndicationController {
7676
private int mChargingCurrent;
7777
private String mMessageToShowOnScreenOn;
7878
private IndicationDirection mIndicationDirection;
79+
private boolean mScreenOnHintsEnabled;
7980

8081
public KeyguardIndicationController(Context context, KeyguardIndicationTextView textView,
8182
LockIcon lockIcon) {
@@ -87,6 +88,7 @@ public KeyguardIndicationController(Context context, KeyguardIndicationTextView
8788
Resources res = context.getResources();
8889
mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold);
8990
mFastThreshold = res.getInteger(R.integer.config_chargingFastThreshold);
91+
mScreenOnHintsEnabled = res.getBoolean(R.bool.config_showScreenOnLockScreenHints);
9092

9193

9294
mBatteryInfo = IBatteryStats.Stub.asInterface(
@@ -189,8 +191,9 @@ private void updateIndication() {
189191
final int color = computeColor();
190192
mTextView.switchIndication(computeIndication());
191193
mTextView.setTextColor(color);
192-
// pad the bottom using ic_empty_space to keep text vertically aligned
193-
int top = 0, bottom = R.drawable.ic_empty_space, left = 0, right = 0;
194+
int top = 0, left = 0, right = 0;
195+
// pad the bottom using ic_empty_space to keep text vertically aligned if needed
196+
int bottom = mScreenOnHintsEnabled ? R.drawable.ic_empty_space : 0;
194197
switch (mIndicationDirection) {
195198
case UP:
196199
top = R.drawable.ic_keyboard_arrow_up;

packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ private boolean getUserReturnedFromLls() {
30713071
return getSharedPreferenceBoolean(KEY_USER_RETURNED_FROM_LLS, false);
30723072
}
30733073

3074-
private boolean shouldShowScreenOnHints() {
3074+
public boolean shouldShowScreenOnHints() {
30753075
return mScreenOnHintsEnabled && mStatusBar.isDeviceProvisioned() &&
30763076
mStatusBarState == StatusBarState.KEYGUARD;
30773077
}

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4796,7 +4796,9 @@ public void onClosingFinished() {
47964796

47974797
public void onUnlockHintStarted() {
47984798
mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock,
4799-
KeyguardIndicationController.IndicationDirection.UP);
4799+
mNotificationPanel.shouldShowScreenOnHints() ?
4800+
KeyguardIndicationController.IndicationDirection.UP :
4801+
KeyguardIndicationController.IndicationDirection.NONE);
48004802
}
48014803

48024804
public void onLlsHintStarted() {

0 commit comments

Comments
 (0)