mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Reduce top padding of Taskbar's All Apps tray.
The top padding looks too high because the code is assuming we have a search bar at the top of the bottom sheet. Until we implement search, we should temporarily reduce padding for the taskbar implementation. Before: - No tabs: https://screenshot.googleplex.com/AAPdR5nbwepWQ82.png - Tabs: https://screenshot.googleplex.com/3DnQp6PKhqXyRag.png After: - No tabs: https://screenshot.googleplex.com/A8enwnSs8r78ccj.png - Tabs: https://screenshot.googleplex.com/A3fAy2bXgmSPrG9.png Test: Manual Bug: 216683257 Change-Id: Ie0837acc3aed162b9428a209962be2a102c515c8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user