From 23c6cb91255f5bee5e6c2d765be55521069ebbaf Mon Sep 17 00:00:00 2001 From: yyalan Date: Tue, 10 May 2022 18:15:18 +0100 Subject: [PATCH] Fix clipping of QS tiles in large screen portrait shade Changed the clipping bounds in large screen portrait to qs container padding + qs container margin. Also fixed qs_tiles_page_horizontal_margin so that it's the half of the clipping margin. Fixes: 228970271 Test: Manual Change-Id: Ia03e717d7fbc6665c56eef0c1d6cb3f681ad5790 --- packages/SystemUI/res/values-sw600dp-port/dimens.xml | 5 +++++ packages/SystemUI/res/values-sw720dp-port/dimens.xml | 6 ++++++ .../SystemUI/src/com/android/systemui/qs/QSFragment.java | 9 +++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/res/values-sw600dp-port/dimens.xml b/packages/SystemUI/res/values-sw600dp-port/dimens.xml index 589d12f95f450..347cf2965c772 100644 --- a/packages/SystemUI/res/values-sw600dp-port/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp-port/dimens.xml @@ -21,5 +21,10 @@ 40dp 20dp + + 32dp + 16dp diff --git a/packages/SystemUI/res/values-sw720dp-port/dimens.xml b/packages/SystemUI/res/values-sw720dp-port/dimens.xml index 2abc9e3d61193..4de7bb7ef1008 100644 --- a/packages/SystemUI/res/values-sw720dp-port/dimens.xml +++ b/packages/SystemUI/res/values-sw720dp-port/dimens.xml @@ -29,5 +29,11 @@ 80dp 40dp + + + 60dp + 16dp diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java index f87cb29a87581..f9bebc52b2584 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java @@ -622,10 +622,11 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca if (mLastQSExpansion == 1.0f) { // Fully expanded, let's set the layout bounds as clip bounds. This is necessary because // it's a scrollview and otherwise wouldn't be clipped. However, we set the horizontal - // bounds so the pages go to the ends of QSContainerImpl - ViewGroup.MarginLayoutParams lp = - (ViewGroup.MarginLayoutParams) mQSPanelScrollView.getLayoutParams(); - mQsBounds.set(-lp.leftMargin, 0, mQSPanelScrollView.getWidth() + lp.rightMargin, + // bounds so the pages go to the ends of QSContainerImpl (most cases) or its parent + // (large screen portrait) + int sideMargin = getResources().getDimensionPixelSize( + R.dimen.qs_tiles_page_horizontal_margin) * 2; + mQsBounds.set(-sideMargin, 0, mQSPanelScrollView.getWidth() + sideMargin, mQSPanelScrollView.getHeight()); } mQSPanelScrollView.setClipBounds(mQsBounds);