From 591670921945549de4571287aba3ec8e89fb983a Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 1 May 2018 12:33:29 -0700 Subject: [PATCH] Bound overscroll shift amount to avoid content from drawing on top (Y-val) of the QSB. Bug: 77538324 Change-Id: Idabc4365c5fe5cb1894fa0eb84ea9309b85f99a3 --- .../android/launcher3/allapps/AllAppsContainerView.java | 8 ++++++++ src/com/android/launcher3/views/SpringRelativeLayout.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index ae41794adb..8b21bbd7fa 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -47,6 +47,7 @@ import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.graphics.ColorScrim; import com.android.launcher3.keyboard.FocusedItemDecorator; @@ -124,6 +125,13 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo return mAllAppsStore; } + @Override + protected void setDampedScrollShift(float shift) { + // Bound the shift amount to avoid content from drawing on top (Y-val) of the QSB. + float maxShift = getSearchView().getHeight() / 2f; + super.setDampedScrollShift(Utilities.boundToRange(shift, -maxShift, maxShift)); + } + @Override public void onDeviceProfileChanged(DeviceProfile dp) { for (AdapterHolder holder : mAH) { diff --git a/src/com/android/launcher3/views/SpringRelativeLayout.java b/src/com/android/launcher3/views/SpringRelativeLayout.java index a508191730..598738b9f7 100644 --- a/src/com/android/launcher3/views/SpringRelativeLayout.java +++ b/src/com/android/launcher3/views/SpringRelativeLayout.java @@ -97,7 +97,7 @@ public class SpringRelativeLayout extends RelativeLayout { mActiveEdge = edge; } - private void setDampedScrollShift(float shift) { + protected void setDampedScrollShift(float shift) { if (shift != mDampedScrollShift) { mDampedScrollShift = shift; invalidate();