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
This commit is contained in:
Michal Brzezinski
2021-07-02 13:46:42 +01:00
parent 32fd255620
commit b35a6b2646

View File

@@ -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;
}