Adds ENABLE_FLOATING_SEARCH_BOX flag for All Apps.

This defines how the All Apps screen should be laid out without
anchoring to the search bar at the top, as follows:
 - Header view aligns to the top instead of below search bar.
 - Same for A-Z list.
 - Scroller is aligned to the header view to receive the above
   adjustments automatically.
 - A-Z list is set above search bar to not peek from below.
 - Search bar is set to align parent bottom and translates up
   with the keyboard.
 - Button to disable work apps is raised above the search bar.

Bug: 213954333
Test: Manually with flag enabled/disabled, Always show keyboard
enabled/disabled, and work profile enabled/disabled.

Change-Id: If90bb39a890029fa7056367fe62bad0677f0b86e
This commit is contained in:
Andy Wickham
2022-01-31 17:57:06 -08:00
parent 14568de2ae
commit cf462e879a
9 changed files with 76 additions and 37 deletions

View File

@@ -368,8 +368,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
}
@Override
public void onDropCompleted(View target, DragObject d, boolean success) {
}
public void onDropCompleted(View target, DragObject d, boolean success) {}
@Override
public void setInsets(Rect insets) {
@@ -478,7 +477,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
return mHasWorkApps;
}
private void replaceRVContainer(boolean showTabs) {
protected View replaceRVContainer(boolean showTabs) {
for (AdapterHolder adapterHolder : mAH) {
if (adapterHolder.mRecyclerView != null) {
adapterHolder.mRecyclerView.setLayoutManager(null);
@@ -503,6 +502,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mWorkManager.detachWorkModeSwitch();
mViewPager = null;
}
return newView;
}
public View getRecyclerViewContainer() {
@@ -634,7 +634,9 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
@Override
public void drawOnScrim(Canvas canvas) {
if (!mHeader.isHeaderProtectionSupported()) return;
if (!mHeader.isHeaderProtectionSupported()) {
return;
}
mHeaderPaint.setColor(mHeaderColor);
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {