Add margins to top and bottom when grid only overview enabled

Fix: 299100244
Test: OverviewImageTest and dump tests
Flag: ACONFIG com.android.launcher3.enable_grid_only_overview TEAMFOOD
Change-Id: I22ebced5bf1e27974036d6e2ef72d2b8d63df824
This commit is contained in:
Uwais Ashraf committed 2023-10-24 16:15:39 +00:00
1 parent fbc8b715c3
commit aa7fa886d6
9 files changed
+65 -26

No files matched your search

+14 -13
View File
@@ -299,6 +299,7 @@ public class DeviceProfile {
public final int stashedTaskbarHeight;
public final int taskbarBottomMargin;
public final int taskbarIconSize;
private final int mTransientTaskbarClaimedSpace;
// If true, used to layout taskbar in 3 button navigation mode.
public final boolean startAlignTaskbar;
public final boolean isTransientTaskbar;
@@ -370,18 +371,23 @@ public class DeviceProfile {
}
this.isTransientTaskbar = isTransientTaskbar;
int transientTaskbarIconSize = pxFromDp(inv.transientTaskbarIconSize[mTypeIndex], mMetrics);
int transientTaskbarBottomMargin =
res.getDimensionPixelSize(R.dimen.transient_taskbar_bottom_margin);
int transientTaskbarHeight =
Math.round((transientTaskbarIconSize * ICON_VISIBLE_AREA_FACTOR)
+ (2 * res.getDimensionPixelSize(R.dimen.transient_taskbar_padding)));
mTransientTaskbarClaimedSpace = transientTaskbarHeight + 2 * transientTaskbarBottomMargin;
if (!isTaskbarPresent) {
taskbarIconSize = taskbarHeight = stashedTaskbarHeight = taskbarBottomMargin = 0;
startAlignTaskbar = false;
} else if (isTransientTaskbar) {
float invTransientIconSizeDp = inv.transientTaskbarIconSize[mTypeIndex];
taskbarIconSize = pxFromDp(invTransientIconSizeDp, mMetrics);
taskbarHeight = Math.round((taskbarIconSize * ICON_VISIBLE_AREA_FACTOR)
+ (2 * res.getDimensionPixelSize(R.dimen.transient_taskbar_padding)));
taskbarIconSize = transientTaskbarIconSize;
taskbarHeight = transientTaskbarHeight;
stashedTaskbarHeight =
res.getDimensionPixelSize(R.dimen.transient_taskbar_stashed_height);
taskbarBottomMargin =
res.getDimensionPixelSize(R.dimen.transient_taskbar_bottom_margin);
taskbarBottomMargin = transientTaskbarBottomMargin;
startAlignTaskbar = false;
} else {
taskbarIconSize = pxFromDp(ResourcesCompat.getFloat(res, R.dimen.taskbar_icon_size),
@@ -1760,14 +1766,9 @@ public class DeviceProfile {
return getHotseatBarBottomPadding() + launcherIconBottomSpace - taskbarIconBottomSpace;
}
/**
* Returns the number of pixels required below OverviewActions excluding insets.
*/
/** Returns the number of pixels required below OverviewActions. */
public int getOverviewActionsClaimedSpaceBelow() {
if (isTaskbarPresent) {
return taskbarHeight + taskbarBottomMargin * 2;
}
return mInsets.bottom;
return isTaskbarPresent ? mTransientTaskbarClaimedSpace : mInsets.bottom;
}
/** Gets the space that the overview actions will take, including bottom margin. */