Merge "Fixes Search bar padding when work profile not present." into tm-dev am: 34e8c3364a am: ef4136ad4e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18789522

Change-Id: I2db55aaab2e0ad4ad8b2f3388f0cc7fe404a2aec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Andy Wickham
2022-06-10 19:41:29 +00:00
committed by Automerger Merge Worker
3 changed files with 13 additions and 5 deletions
@@ -128,6 +128,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
private final int mScrimColor;
private final int mHeaderProtectionColor;
protected final float mHeaderThreshold;
private int mHeaderBottomAdjustment;
private ScrimView mScrimView;
private int mHeaderColor;
private int mTabsProtectionAlpha;
@@ -140,6 +141,8 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
mHeaderThreshold = getResources().getDimensionPixelSize(
R.dimen.dynamic_grid_cell_border_spacing);
mHeaderBottomAdjustment = getResources().getDimensionPixelSize(
R.dimen.all_apps_header_bottom_adjustment);
mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor);
mWorkManager = new WorkProfileManager(
@@ -722,6 +725,9 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
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) {