From b35a6b26467ef7cd5f3bb6bf8890ee60eec0b2c9 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Fri, 2 Jul 2021 13:46:42 +0100 Subject: [PATCH] Making notification width dependent on orientation instead of rotation Notification width was calculated based on rotation with the assumption that no rotation means portrait. That's true for phones, but for bigger screens no rotation (aka natural orientation) can be also landscape. In that case width is adjusted incorrectly, this change makes it dependent on orientation instead. Fixes: 192498450 Test: manual Change-Id: I21271c67052a69f0e4d2dc76dba9b147d34aa4cb --- .../notification/stack/NotificationStackScrollLayout.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 35914c0f28fc5..906e169dca42d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -112,7 +112,6 @@ import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.util.Assert; -import com.android.systemui.util.leak.RotationUtils; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -950,7 +949,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable return; } // Portrait is easy, just use the dimen for paddings - if (RotationUtils.getRotation(mContext) == RotationUtils.ROTATION_NONE) { + if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { mSidePaddings = mMinimumPaddings; return; }