mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Merge "Reduce top padding of Taskbar's All Apps tray." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a5953002d4
@@ -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">
|
||||
|
||||
<include layout="@layout/floating_header_content" />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,9 @@ public class ActivityAllAppsContainerView<T extends Context & AppLauncher
|
||||
|
||||
removeCustomRules(rvContainer);
|
||||
removeCustomRules(getSearchRecyclerView());
|
||||
if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
|
||||
if (!isSearchSupported()) {
|
||||
layoutWithoutSearchContainer(rvContainer, showTabs);
|
||||
} else if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
|
||||
alignParentTop(rvContainer, showTabs);
|
||||
alignParentTop(getSearchRecyclerView(), /* tabs= */ false);
|
||||
layoutAboveSearchContainer(rvContainer);
|
||||
@@ -342,4 +344,21 @@ public class ActivityAllAppsContainerView<T extends Context & AppLauncher
|
||||
return new AllAppsGridAdapter<>(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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user