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

Commit dfc4a0dd authored by Julia Tuttle's avatar Julia Tuttle Committed by Cherrypicker Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:13203c2c38032acdc85f4927922179712ff60bc4)
Merged-In: Iaeb97db2e4808cbec131019a2f2dcc6a679fa642
Change-Id: Iaeb97db2e4808cbec131019a2f2dcc6a679fa642
parent 92d95cfa
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1161,17 +1161,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;