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

Commit 13203c2c authored by Julia Tuttle's avatar Julia Tuttle
Browse files

NSSL: Apply skinny notifs based on split shade state

Currently, we're relying on some complex config/resource logic to decide
whether to use the skinny notif layout, and it seems like it might be
flaky.

Therefore, check *directly* whether NSSL should use the split shade, and
use *that* to decide whether to use the skinny notif layout.

Bug: 328588062
Test: postsubmit
Flag: NA
Change-Id: Iaeb97db2e4808cbec131019a2f2dcc6a679fa642
parent 73ba7573
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -962,17 +962,25 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                            + ": " + mLastUpdateSidePaddingDumpString);
        }

        if (viewWidth == 0 || !mSkinnyNotifsInLandscape) {
        if (viewWidth == 0) {
            Log.e(TAG, "updateSidePadding: viewWidth is zero");
            mSidePaddings = mMinimumPaddings;
            return;
        }

        // Portrait is easy, just use the dimen for paddings
        if (orientation == Configuration.ORIENTATION_PORTRAIT) {
            mSidePaddings = mMinimumPaddings;
            return;
        }

        if (mShouldUseSplitNotificationShade) {
            if (mSkinnyNotifsInLandscape) {
                Log.e(TAG, "updateSidePadding: mSkinnyNotifsInLandscape has betrayed us!");
            }
            mSidePaddings = mMinimumPaddings;
            return;
        }

        final int innerWidth = viewWidth - mMinimumPaddings * 2;
        final int qsTileWidth = (innerWidth - mQsTilePadding * 3) / 4;
        mSidePaddings = mMinimumPaddings + qsTileWidth + mQsTilePadding;