lineage_patches_unified/patches_platform/frameworks_base/0034-SystemUI-Calculate-paged-QS-tiles-height-properly.patch
2024-07-21 17:16:11 +08:00

46 lines
1.8 KiB
Diff

From 25940ffbfecb8b9eed4d9d461b11ea4af3b96e41 Mon Sep 17 00:00:00 2001
From: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date: Mon, 30 May 2022 00:13:02 +0530
Subject: [PATCH 34/43] SystemUI: Calculate paged QS tiles height properly
When QS is re-inflated during UI mode change and we're on the
3rd or higher QS page, the first QS page is misaligned and
hence height returns 0, resulting in footer and media panel
position overlapping the QS panel. Return the maximum height
among all present QS pages to fix this issue.
Change-Id: I539babdb75c114cc44b4213ff114d4272be22ef6
---
.../com/android/systemui/qs/PagedTileLayout.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index 43f3a2242da4..c7f74705a81e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -137,12 +137,16 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
@Override
public int getTilesHeight() {
- // Use the first page as that is the maximum height we need to show.
- TileLayout tileLayout = mPages.get(0);
- if (tileLayout == null) {
- return 0;
+ // Find the maximum height among all pages.
+ int height = 0;
+ for (int i = 0; i < mPages.size(); i++) {
+ TileLayout tileLayout = mPages.get(i);
+ if (tileLayout != null) {
+ height = Math.max(height, tileLayout.getTilesHeight());
+ }
}
- return tileLayout.getTilesHeight();
+ mLogger.d("getTilesHeight ret=", height);
+ return height;
}
@Override
--
2.34.1