Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4be68cd3 authored by Matthias Yzusqui's avatar Matthias Yzusqui Committed by Gerrit Code Review
Browse files

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
parent db7e3897
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }
+3 −1
Original line number Diff line number Diff line
@@ -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() {