summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Lin <danny@kdrag0n.dev>2021-12-29 21:02:38 -0800
committeralk3pInjection <webmaster@raspii.tech>2022-05-06 14:30:30 +0800
commit24aeffb174cdc3e72887109c018e04f7f7eb7310 (patch)
treedbcc0a839213f4517dcb635511cc4b2f04033a32
parent6d303efe74b4c5c0422dfd2c1889832340f38a1e (diff)
Launcher3: Fix header protection height calculation
The app list is being clipped below the point where header protection ends, resulting in a slice of empty space. Fix the height calculation so the header protection scrim extends to the clip point. Squashed with the following commit: Author: Danny Lin <danny@kdrag0n.dev> Date: Wed, 29 Dec 2021 21:07:38 -0800 overlay: Launcher3: Re-enable header protection Google disabled this in qpr1, but we can re-enable it now that we've fixed the height/clip calculation. Change-Id: I7a0dc74f048d422d405eb0b0e3982b5d39245ae4
-rw-r--r--res/values/config.xml2
-rw-r--r--src/com/android/launcher3/allapps/FloatingHeaderView.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 25911e688f..2a001fb971 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -35,7 +35,7 @@
<string name="popup_container_iterate_children" translatable="false">popup_container_iterate_children</string>
<!-- config used to determine if header protection is supported in AllApps -->
- <bool name="config_header_protection_supported">false</bool>
+ <bool name="config_header_protection_supported">true</bool>
<!-- Workspace -->
<!-- The duration (in ms) of the fade animation on the object outlines, used when
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 85ee636a12..44ec71c2ec 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -314,7 +314,7 @@ public class FloatingHeaderView extends LinearLayout implements
mTabLayout.setTranslationY(mTranslationY);
- int clipHeight = mHeaderTopPadding - getPaddingBottom();
+ int clipHeight = mHeaderTopPadding - getPaddingBottom() * 2;
mRVClip.top = mTabsHidden ? clipHeight : 0;
mHeaderClip.top = clipHeight;
// clipping on a draw might cause additional redraw
@@ -441,7 +441,7 @@ public class FloatingHeaderView extends LinearLayout implements
if (mTabsHidden || !mHeaderCollapsed) {
return 0;
}
- return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0);
+ return Math.max(getHeight() - getPaddingTop() + mTranslationY + getPaddingBottom(), 0);
}
}