mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Add 16dp between nav bar and container by setting extra padding to the recyclerView.
bug:298593161 Test: manual: (Adjusting bottom padding of recyclerView): 3button nav after closed: https://drive.google.com/file/d/1xTXtzOC-n3_vGXs34FjL_52jiY60piAA/view?usp=sharing 3button nav after opened: https://drive.google.com/file/d/1xS4Wu41-4ogYzVRh1UxDW39DZW214vSz/view?usp=sharing gesture nav after closed: https://drive.google.com/file/d/1xQGL-Qi5sGwWqQsOLQAsvxpNlJGklBSg/view?usp=sharing gesture nav after opened: https://drive.google.com/file/d/1xQ9YNUv89RsT9Tsa85BlEt64twDHk-l6/view?usp=sharing (USING DIVIDER METHOD): 3button nav after closed: https://drive.google.com/file/d/1YG1pFmU4023-wO2okC_wkwsW5L8IUTkl/view?usp=sharing 3button nav after opened: https://drive.google.com/file/d/1YCBIqzFkxNH9fNuE0o2YTz_221ZRAmSA/view?usp=sharing gesture nav after closed: https://drive.google.com/file/d/1YIBRglQk6SsSe7_nbggcQZBE7aERGT74/view?usp=sharing gesture nav after opened: https://drive.google.com/file/d/1YGzbgQPRFKhuSZ95BF6fx_8NfPyocCxN/view?usp=sharing Flag: ACONFIG com.android.launcher3.Flags.enable_private_space Change-Id: Ibfd4896c1477b3e498389d6451ca458a01d98952
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.launcher3.allapps;
|
||||
import static com.android.launcher3.Flags.enableExpandingPauseWorkButton;
|
||||
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.MAIN;
|
||||
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.SEARCH;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_HEADER;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_DISABLED_CARD;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_EDU_CARD;
|
||||
import static com.android.launcher3.config.FeatureFlags.ALL_APPS_GONE_VISIBILITY;
|
||||
@@ -97,6 +98,7 @@ import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -158,6 +160,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
};
|
||||
private final Paint mNavBarScrimPaint;
|
||||
private final int mHeaderProtectionColor;
|
||||
private final int mPrivateSpaceBottomExtraSpace;
|
||||
private final Path mTmpPath = new Path();
|
||||
private final RectF mTmpRectF = new RectF();
|
||||
protected AllAppsPagedView mViewPager;
|
||||
@@ -222,6 +225,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
this,
|
||||
mActivityContext.getStatsLogManager(),
|
||||
UserCache.INSTANCE.get(mActivityContext));
|
||||
mPrivateSpaceBottomExtraSpace = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.ps_extra_bottom_padding);
|
||||
mAH = Arrays.asList(null, null, null);
|
||||
mNavBarScrimPaint = new Paint();
|
||||
mNavBarScrimPaint.setColor(Themes.getNavBarScrimColor(mActivityContext));
|
||||
@@ -1566,6 +1571,14 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
int bottomOffset = 0;
|
||||
if (isWork() && mWorkManager.getWorkModeSwitch() != null) {
|
||||
bottomOffset = mInsets.bottom + mWorkManager.getWorkModeSwitch().getHeight();
|
||||
} else if (isMain() && mPrivateProfileManager != null) {
|
||||
Optional<AdapterItem> privateSpaceHeaderItem = mAppsList.getAdapterItems()
|
||||
.stream()
|
||||
.filter(item -> item.viewType == VIEW_TYPE_PRIVATE_SPACE_HEADER)
|
||||
.findFirst();
|
||||
if (privateSpaceHeaderItem.isPresent()) {
|
||||
bottomOffset = mPrivateSpaceBottomExtraSpace;
|
||||
}
|
||||
}
|
||||
if (isSearchBarFloating()) {
|
||||
bottomOffset += mSearchContainer.getHeight();
|
||||
@@ -1582,5 +1595,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
private boolean isSearch() {
|
||||
return mType == SEARCH;
|
||||
}
|
||||
|
||||
private boolean isMain() {
|
||||
return mType == MAIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user