Loading res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,9 @@ <dimen name="all_apps_header_pill_corner_radius">12dp</dimen> <dimen name="all_apps_header_tab_height">48dp</dimen> <dimen name="all_apps_tabs_indicator_height">2dp</dimen> <dimen name="all_apps_header_top_margin">48dp</dimen> <dimen name="all_apps_header_top_margin">33dp</dimen> <dimen name="all_apps_header_top_padding">36dp</dimen> <dimen name="all_apps_header_bottom_padding">10dp</dimen> <dimen name="all_apps_header_bottom_padding">14dp</dimen> <dimen name="all_apps_header_top_adjustment">6dp</dimen> <dimen name="all_apps_header_bottom_adjustment">4dp</dimen> <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen> Loading src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +6 −10 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte private final int mHeaderProtectionColor; protected final float mHeaderThreshold; private int mHeaderBottomAdjustment; private int mHeaderTopAdjustment; private ScrimView mScrimView; private int mHeaderColor; private int mTabsProtectionAlpha; Loading @@ -144,8 +143,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte R.dimen.dynamic_grid_cell_border_spacing); mHeaderBottomAdjustment = getResources().getDimensionPixelSize( R.dimen.all_apps_header_bottom_adjustment); mHeaderTopAdjustment = getResources().getDimensionPixelSize( R.dimen.all_apps_header_top_adjustment); mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor); mWorkManager = new WorkProfileManager( Loading Loading @@ -731,16 +728,15 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte mHeaderPaint.setColor(mHeaderColor); mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor))); if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) { final int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight(); final int floatingHeaderBottom = getFloatingHeaderView().getBottom(); final int floatingHeaderPaddingBottom = getFloatingHeaderView().getPaddingBottom(); final int bottom = floatingHeaderBottom - floatingHeaderPaddingBottom - tabsHeight; int bottom = getHeaderBottom(); if (!mUsingTabs) { bottom += getFloatingHeaderView().getPaddingBottom() - mHeaderBottomAdjustment; } canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint); int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight(); if (mTabsProtectionAlpha > 0 && tabsHeight != 0) { mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha)); // Why use mHeaderTopAdjustment? Because it works. final int protectionBottom = floatingHeaderBottom - mHeaderTopAdjustment; canvas.drawRect(0, bottom, canvas.getWidth(), protectionBottom, mHeaderPaint); canvas.drawRect(0, bottom, canvas.getWidth(), bottom + tabsHeight, mHeaderPaint); } } } Loading src/com/android/launcher3/allapps/FloatingHeaderView.java +1 −8 Original line number Diff line number Diff line Loading @@ -83,8 +83,6 @@ public class FloatingHeaderView extends LinearLayout implements // These two values are necessary to ensure that the header protection is drawn correctly. private final int mHeaderTopAdjustment; private final int mHeaderBottomAdjustment; private final int mHeaderPillHeight; private final int mHeaderTopMargin; private final boolean mHeaderProtectionSupported; protected ViewGroup mTabLayout; Loading Loading @@ -126,10 +124,6 @@ public class FloatingHeaderView extends LinearLayout implements R.bool.config_header_protection_supported) // TODO(b/208599118) Support header protection for bottom sheet. && !ActivityContext.lookupContext(context).getDeviceProfile().isTablet; mHeaderPillHeight = context.getResources() .getDimensionPixelSize(R.dimen.all_apps_header_pill_height); mHeaderTopMargin = context.getResources() .getDimensionPixelSize(R.dimen.all_apps_header_top_margin); } @Override Loading Loading @@ -450,7 +444,6 @@ public class FloatingHeaderView extends LinearLayout implements if (mTabsHidden || !mHeaderCollapsed) { return 0; } return Math.max(mHeaderPillHeight - getPaddingTop() + mHeaderTopMargin + mTranslationY, 0); return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0); } } Loading
res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,9 @@ <dimen name="all_apps_header_pill_corner_radius">12dp</dimen> <dimen name="all_apps_header_tab_height">48dp</dimen> <dimen name="all_apps_tabs_indicator_height">2dp</dimen> <dimen name="all_apps_header_top_margin">48dp</dimen> <dimen name="all_apps_header_top_margin">33dp</dimen> <dimen name="all_apps_header_top_padding">36dp</dimen> <dimen name="all_apps_header_bottom_padding">10dp</dimen> <dimen name="all_apps_header_bottom_padding">14dp</dimen> <dimen name="all_apps_header_top_adjustment">6dp</dimen> <dimen name="all_apps_header_bottom_adjustment">4dp</dimen> <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen> Loading
src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +6 −10 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte private final int mHeaderProtectionColor; protected final float mHeaderThreshold; private int mHeaderBottomAdjustment; private int mHeaderTopAdjustment; private ScrimView mScrimView; private int mHeaderColor; private int mTabsProtectionAlpha; Loading @@ -144,8 +143,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte R.dimen.dynamic_grid_cell_border_spacing); mHeaderBottomAdjustment = getResources().getDimensionPixelSize( R.dimen.all_apps_header_bottom_adjustment); mHeaderTopAdjustment = getResources().getDimensionPixelSize( R.dimen.all_apps_header_top_adjustment); mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor); mWorkManager = new WorkProfileManager( Loading Loading @@ -731,16 +728,15 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte mHeaderPaint.setColor(mHeaderColor); mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor))); if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) { final int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight(); final int floatingHeaderBottom = getFloatingHeaderView().getBottom(); final int floatingHeaderPaddingBottom = getFloatingHeaderView().getPaddingBottom(); final int bottom = floatingHeaderBottom - floatingHeaderPaddingBottom - tabsHeight; int bottom = getHeaderBottom(); if (!mUsingTabs) { bottom += getFloatingHeaderView().getPaddingBottom() - mHeaderBottomAdjustment; } canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint); int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight(); if (mTabsProtectionAlpha > 0 && tabsHeight != 0) { mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha)); // Why use mHeaderTopAdjustment? Because it works. final int protectionBottom = floatingHeaderBottom - mHeaderTopAdjustment; canvas.drawRect(0, bottom, canvas.getWidth(), protectionBottom, mHeaderPaint); canvas.drawRect(0, bottom, canvas.getWidth(), bottom + tabsHeight, mHeaderPaint); } } } Loading
src/com/android/launcher3/allapps/FloatingHeaderView.java +1 −8 Original line number Diff line number Diff line Loading @@ -83,8 +83,6 @@ public class FloatingHeaderView extends LinearLayout implements // These two values are necessary to ensure that the header protection is drawn correctly. private final int mHeaderTopAdjustment; private final int mHeaderBottomAdjustment; private final int mHeaderPillHeight; private final int mHeaderTopMargin; private final boolean mHeaderProtectionSupported; protected ViewGroup mTabLayout; Loading Loading @@ -126,10 +124,6 @@ public class FloatingHeaderView extends LinearLayout implements R.bool.config_header_protection_supported) // TODO(b/208599118) Support header protection for bottom sheet. && !ActivityContext.lookupContext(context).getDeviceProfile().isTablet; mHeaderPillHeight = context.getResources() .getDimensionPixelSize(R.dimen.all_apps_header_pill_height); mHeaderTopMargin = context.getResources() .getDimensionPixelSize(R.dimen.all_apps_header_top_margin); } @Override Loading Loading @@ -450,7 +444,6 @@ public class FloatingHeaderView extends LinearLayout implements if (mTabsHidden || !mHeaderCollapsed) { return 0; } return Math.max(mHeaderPillHeight - getPaddingTop() + mHeaderTopMargin + mTranslationY, 0); return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0); } }