diff --git a/quickstep/res/layout/taskbar_all_apps.xml b/quickstep/res/layout/taskbar_all_apps.xml
index a0dce65a45..c7679beb23 100644
--- a/quickstep/res/layout/taskbar_all_apps.xml
+++ b/quickstep/res/layout/taskbar_all_apps.xml
@@ -48,7 +48,6 @@
android:layout_height="wrap_content"
android:layout_below="@id/search_container_all_apps"
android:clipToPadding="false"
- android:paddingTop="@dimen/all_apps_header_top_padding"
android:orientation="vertical">
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
index e41c75fea0..f8d9d11d39 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
@@ -39,4 +39,9 @@ public class TaskbarAllAppsContainerView extends
setInsets(insets.getInsets(WindowInsets.Type.systemBars()).toRect());
return super.onApplyWindowInsets(insets);
}
+
+ @Override
+ protected boolean isSearchSupported() {
+ return false;
+ }
}
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index c86f08d1fb..e4e56a904e 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -228,7 +228,9 @@ public class ActivityAllAppsContainerView(mActivityContext, getLayoutInflater(), appsList,
adapterProviders);
}
+
+ // TODO(b/216683257): Remove when Taskbar All Apps supports search.
+ protected boolean isSearchSupported() {
+ return true;
+ }
+
+ private void layoutWithoutSearchContainer(View v, boolean includeTabsMargin) {
+ if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
+ return;
+ }
+
+ RelativeLayout.LayoutParams layoutParams = (LayoutParams) v.getLayoutParams();
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
+ layoutParams.topMargin = getContext().getResources().getDimensionPixelSize(includeTabsMargin
+ ? R.dimen.all_apps_header_pill_height
+ : R.dimen.all_apps_header_top_margin);
+ }
}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index ac10892ece..d308fcb3b8 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -258,7 +258,9 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
}
public int getScrollBarTop() {
- return getResources().getDimensionPixelOffset(R.dimen.all_apps_header_top_padding);
+ return ActivityContext.lookupContext(getContext()).getAppsView().isSearchSupported()
+ ? getResources().getDimensionPixelOffset(R.dimen.all_apps_header_top_padding)
+ : 0;
}
public RecyclerViewFastScroller getScrollbar() {