diff --git a/res/layout/all_apps_fast_scroller.xml b/res/layout/all_apps_fast_scroller.xml index f6a61569ee..0f1d9330a6 100644 --- a/res/layout/all_apps_fast_scroller.xml +++ b/res/layout/all_apps_fast_scroller.xml @@ -22,6 +22,7 @@ style="@style/FastScrollerPopup" android:layout_alignParentEnd="true" android:layout_alignTop="@+id/all_apps_header" + android:layout_marginTop="@dimen/all_apps_header_bottom_padding" android:layout_marginEnd="@dimen/fastscroll_popup_margin" /> diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index 2cefc6c28d..4256fe79c1 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -128,6 +128,7 @@ public abstract class BaseAllAppsContainerView 0 && tabsHeight != 0) { diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java index 641161b9c5..6ecbad24e8 100644 --- a/src/com/android/launcher3/allapps/FloatingHeaderView.java +++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java @@ -81,7 +81,6 @@ public class FloatingHeaderView extends LinearLayout implements protected final Map mPluginRows = new ArrayMap<>(); - private final int mHeaderTopPadding; // These two values are necessary to ensure that the header protection is drawn correctly. private final int mHeaderTopAdjustment; private final int mHeaderBottomAdjustment; @@ -118,8 +117,6 @@ public class FloatingHeaderView extends LinearLayout implements public FloatingHeaderView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); - mHeaderTopPadding = context.getResources() - .getDimensionPixelSize(R.dimen.all_apps_header_top_padding); mHeaderTopAdjustment = context.getResources() .getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment); mHeaderBottomAdjustment = context.getResources() @@ -326,7 +323,7 @@ public class FloatingHeaderView extends LinearLayout implements int uncappedTranslationY = mTranslationY; mTranslationY = Math.max(mTranslationY, -mMaxTranslation); - if (mCollapsed || uncappedTranslationY < mTranslationY - mHeaderTopPadding) { + if (mCollapsed || uncappedTranslationY < mTranslationY - getPaddingTop()) { // we hide it completely if already capped (for opening search anim) for (FloatingHeaderRow row : mAllRows) { row.setVerticalScroll(0, true /* isScrolledOut */); @@ -339,7 +336,10 @@ public class FloatingHeaderView extends LinearLayout implements mTabLayout.setTranslationY(mTranslationY); - int clipTop = mHeaderTopPadding - mHeaderTopAdjustment; + int clipTop = getPaddingTop() - mHeaderTopAdjustment; + if (mTabsHidden) { + clipTop += getPaddingBottom() - mHeaderBottomAdjustment; + } mRVClip.top = mTabsHidden ? clipTop : 0; mHeaderClip.top = clipTop; // clipping on a draw might cause additional redraw