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

Unverified Commit 518321cc authored by Danny Lin's avatar Danny Lin Committed by Michael Bestas
Browse files

SystemUI: Fix keyguard clock/status and AOD layouts without smartspace

The keyguard clock layout is broken and overlaps the UDFPS icon on AOSP
because there's no smartspace view, and the KeyguardStatusArea isn't
accounted for correctly. Fix it by using the KeyguardStatusArea as the
smartspace view when there's no smartspace, so we follow the same code
paths and thus get the correct layout.

As a side effect, this also makes the status/smartspace position on the
AOD and big clock lock screen match that of Pixel stock.

Change-Id: Ic2cf0909f1b3c588ed4bf9cbae2dc78b40afa7b9
parent 4cc8827e
Loading
Loading
Loading
Loading
+27 −22
Original line number Diff line number Diff line
@@ -199,19 +199,25 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        }
        updateAodIcons();

        if (mSmartspaceController.isEnabled()) {
            mSmartspaceView = mSmartspaceController.buildAndConnectView(mView);

        View ksa = mView.findViewById(R.id.keyguard_status_area);
            int ksaIndex = mView.indexOfChild(ksa);
            ksa.setVisibility(View.GONE);

        // Place smartspace view below normal clock...
        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
                MATCH_PARENT, WRAP_CONTENT);
        lp.addRule(RelativeLayout.BELOW, R.id.lockscreen_clock_view);

        if (mSmartspaceController.isEnabled()) {
            mSmartspaceView = mSmartspaceController.buildAndConnectView(mView);

            int ksaIndex = mView.indexOfChild(ksa);
            ksa.setVisibility(View.GONE);
            mView.addView(mSmartspaceView, ksaIndex, lp);
        } else {
            // Use KSA as the smartspace view and apply the same layout rules to it
            mSmartspaceView = ksa;
            ksa.setLayoutParams(lp);
        }

        int startPadding = getContext().getResources()
                .getDimensionPixelSize(R.dimen.below_clock_padding_start);
        int endPadding = getContext().getResources()
@@ -229,7 +235,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mView.setSmartspaceView(mSmartspaceView);
        mSmartspaceTransitionController.setLockscreenSmartspace(mSmartspaceView);
    }
    }

    int getNotificationIconAreaHeight() {
        return mNotificationIconAreaController.getHeight();
@@ -268,7 +273,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
    }

    private void updateClockLayout() {
        if (mSmartspaceController.isEnabled()) {
        if (mSmartspaceView != null) {
            RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT,
                    MATCH_PARENT);
            mLargeClockTopMargin = getContext().getResources().getDimensionPixelSize(