Merge "Fixes Search bar padding when work profile not present." into tm-dev am: 34e8c3364a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18789522 Change-Id: I8d658f44c3aba4e8909a88853ee92beaa01aaf84 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
style="@style/FastScrollerPopup"
|
style="@style/FastScrollerPopup"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignTop="@+id/all_apps_header"
|
android:layout_alignTop="@+id/all_apps_header"
|
||||||
|
android:layout_marginTop="@dimen/all_apps_header_bottom_padding"
|
||||||
android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
|
android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
|
||||||
|
|
||||||
<com.android.launcher3.views.RecyclerViewFastScroller
|
<com.android.launcher3.views.RecyclerViewFastScroller
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignTop="@+id/all_apps_header"
|
android:layout_alignTop="@+id/all_apps_header"
|
||||||
|
android:layout_marginTop="@dimen/all_apps_header_bottom_padding"
|
||||||
android:layout_marginEnd="@dimen/fastscroll_end_margin"
|
android:layout_marginEnd="@dimen/fastscroll_end_margin"
|
||||||
launcher:canThumbDetach="true" />
|
launcher:canThumbDetach="true" />
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
|||||||
private final int mScrimColor;
|
private final int mScrimColor;
|
||||||
private final int mHeaderProtectionColor;
|
private final int mHeaderProtectionColor;
|
||||||
protected final float mHeaderThreshold;
|
protected final float mHeaderThreshold;
|
||||||
|
private int mHeaderBottomAdjustment;
|
||||||
private ScrimView mScrimView;
|
private ScrimView mScrimView;
|
||||||
private int mHeaderColor;
|
private int mHeaderColor;
|
||||||
private int mTabsProtectionAlpha;
|
private int mTabsProtectionAlpha;
|
||||||
@@ -140,6 +141,8 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
|||||||
mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
|
mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
|
||||||
mHeaderThreshold = getResources().getDimensionPixelSize(
|
mHeaderThreshold = getResources().getDimensionPixelSize(
|
||||||
R.dimen.dynamic_grid_cell_border_spacing);
|
R.dimen.dynamic_grid_cell_border_spacing);
|
||||||
|
mHeaderBottomAdjustment = getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.all_apps_header_bottom_adjustment);
|
||||||
mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor);
|
mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor);
|
||||||
|
|
||||||
mWorkManager = new WorkProfileManager(
|
mWorkManager = new WorkProfileManager(
|
||||||
@@ -722,6 +725,9 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
|||||||
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
|
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
|
||||||
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
|
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
|
||||||
int bottom = getHeaderBottom();
|
int bottom = getHeaderBottom();
|
||||||
|
if (!mUsingTabs) {
|
||||||
|
bottom += getFloatingHeaderView().getPaddingBottom() - mHeaderBottomAdjustment;
|
||||||
|
}
|
||||||
canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint);
|
canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint);
|
||||||
int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
|
int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
|
||||||
if (mTabsProtectionAlpha > 0 && tabsHeight != 0) {
|
if (mTabsProtectionAlpha > 0 && tabsHeight != 0) {
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ public class FloatingHeaderView extends LinearLayout implements
|
|||||||
|
|
||||||
protected final Map<AllAppsRow, PluginHeaderRow> mPluginRows = new ArrayMap<>();
|
protected final Map<AllAppsRow, PluginHeaderRow> mPluginRows = new ArrayMap<>();
|
||||||
|
|
||||||
private final int mHeaderTopPadding;
|
|
||||||
// These two values are necessary to ensure that the header protection is drawn correctly.
|
// These two values are necessary to ensure that the header protection is drawn correctly.
|
||||||
private final int mHeaderTopAdjustment;
|
private final int mHeaderTopAdjustment;
|
||||||
private final int mHeaderBottomAdjustment;
|
private final int mHeaderBottomAdjustment;
|
||||||
@@ -118,8 +117,6 @@ public class FloatingHeaderView extends LinearLayout implements
|
|||||||
|
|
||||||
public FloatingHeaderView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
public FloatingHeaderView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
mHeaderTopPadding = context.getResources()
|
|
||||||
.getDimensionPixelSize(R.dimen.all_apps_header_top_padding);
|
|
||||||
mHeaderTopAdjustment = context.getResources()
|
mHeaderTopAdjustment = context.getResources()
|
||||||
.getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment);
|
.getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment);
|
||||||
mHeaderBottomAdjustment = context.getResources()
|
mHeaderBottomAdjustment = context.getResources()
|
||||||
@@ -326,7 +323,7 @@ public class FloatingHeaderView extends LinearLayout implements
|
|||||||
int uncappedTranslationY = mTranslationY;
|
int uncappedTranslationY = mTranslationY;
|
||||||
mTranslationY = Math.max(mTranslationY, -mMaxTranslation);
|
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)
|
// we hide it completely if already capped (for opening search anim)
|
||||||
for (FloatingHeaderRow row : mAllRows) {
|
for (FloatingHeaderRow row : mAllRows) {
|
||||||
row.setVerticalScroll(0, true /* isScrolledOut */);
|
row.setVerticalScroll(0, true /* isScrolledOut */);
|
||||||
@@ -339,7 +336,10 @@ public class FloatingHeaderView extends LinearLayout implements
|
|||||||
|
|
||||||
mTabLayout.setTranslationY(mTranslationY);
|
mTabLayout.setTranslationY(mTranslationY);
|
||||||
|
|
||||||
int clipTop = mHeaderTopPadding - mHeaderTopAdjustment;
|
int clipTop = getPaddingTop() - mHeaderTopAdjustment;
|
||||||
|
if (mTabsHidden) {
|
||||||
|
clipTop += getPaddingBottom() - mHeaderBottomAdjustment;
|
||||||
|
}
|
||||||
mRVClip.top = mTabsHidden ? clipTop : 0;
|
mRVClip.top = mTabsHidden ? clipTop : 0;
|
||||||
mHeaderClip.top = clipTop;
|
mHeaderClip.top = clipTop;
|
||||||
// clipping on a draw might cause additional redraw
|
// clipping on a draw might cause additional redraw
|
||||||
|
|||||||
Reference in New Issue
Block a user