diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 1761096d88..20762b9a70 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -27,10 +27,8 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.annotation.Nullable; import android.content.SharedPreferences; -import android.content.res.Resources; import android.view.ViewConfiguration; -import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.util.MultiValueAlpha.AlphaProperty; import com.android.quickstep.AnimatedFloat; @@ -146,10 +144,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba public TaskbarStashController(TaskbarActivityContext activity) { mActivity = activity; mPrefs = Utilities.getPrefs(mActivity); - final Resources resources = mActivity.getResources(); - mStashedHeight = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size); mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity); mUnstashedHeight = mActivity.getDeviceProfile().taskbarSize; + mStashedHeight = mActivity.getDeviceProfile().stashedTaskbarSize; } public void init(TaskbarControllers controllers, TaskbarSharedState sharedState) { diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java index fcc6272306..6a3286b343 100644 --- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java +++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java @@ -214,12 +214,13 @@ public class OverviewActionsView extends FrameLayo setPadding(mInsets.left, 0, mInsets.right + additionalPadding, 0); } - // Align vertically, using taskbar height + mDp.taskbarOffsetY() to guestimate - // where the button nav top is + // Align vertically, using taskbar height + mDp.taskbarOffsetY() to estimate where + // the button nav top is. View startActionView = findViewById(R.id.action_screenshot); int marginBottom = getOverviewActionsBottomMarginPx( SysUINavigationMode.getMode(getContext()), mDp); - int actionsTop = (mDp.heightPx - marginBottom - mInsets.bottom); + int actionsTop = + (mDp.heightPx - marginBottom - mInsets.bottom) - startActionView.getHeight(); int navTop = mDp.heightPx - (mDp.taskbarSize + mDp.getTaskbarOffsetY()); int transY = navTop - actionsTop + ((mDp.taskbarSize - startActionView.getHeight()) / 2); @@ -296,10 +297,13 @@ public class OverviewActionsView extends FrameLayo return inset; } + // Actions button will be aligned with nav buttons in updatePaddingAndTranslations(). if (mode == SysUINavigationMode.Mode.THREE_BUTTONS) { return dp.overviewActionsMarginThreeButtonPx + inset; } - return dp.overviewActionsBottomMarginGesturePx + inset; + // There is no bottom inset when taskbar is present, use stashed taskbar as padding instead. + return dp.overviewActionsBottomMarginGesturePx + + (dp.isTaskbarPresent ? dp.stashedTaskbarSize : inset); } } diff --git a/res/values/dimens.xml b/res/values/dimens.xml index a6c5ed8d75..ddc7d10994 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -324,6 +324,7 @@ 0dp + 0dp 0dp 44dp diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 1a5b3214bd..49981be754 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -219,6 +219,7 @@ public class DeviceProfile { // Whether Taskbar will inset the bottom of apps by taskbarSize. public boolean isTaskbarPresentInApps; public int taskbarSize; + public int stashedTaskbarSize; // DragController public int flingToDeleteThresholdVelocity; @@ -256,12 +257,7 @@ public class DeviceProfile { widthPx = windowBounds.bounds.width(); heightPx = windowBounds.bounds.height(); availableWidthPx = windowBounds.availableSize.x; - int taskbarInset = isTaskbarPresent - ? ResourceUtils.getNavbarSize( - isLandscape ? "navigation_bar_height_landscape" : "navigation_bar_height", - res) - : 0; - availableHeightPx = windowBounds.availableSize.y - taskbarInset; + availableHeightPx = windowBounds.availableSize.y; aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx); boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0; @@ -283,6 +279,7 @@ public class DeviceProfile { if (isTaskbarPresent) { taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size); + stashedTaskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_stashed_size); } edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java index 5ef3690ddf..e3aa758eae 100644 --- a/src/com/android/launcher3/LauncherRootView.java +++ b/src/com/android/launcher3/LauncherRootView.java @@ -105,8 +105,9 @@ public class LauncherRootView extends InsettableFrameLayout { resources, INVALID_RESOURCE_HANDLE) == 2; if (dp.isTablet || isGesturalMode) { - newNavInsets.bottom = ResourceUtils.getNavbarSize( - "navigation_bar_height_landscape", resources); + newNavInsets.bottom = dp.isTaskbarPresent + ? 0 + : ResourceUtils.getNavbarSize("navigation_bar_height_landscape", resources); } else { int navWidth = ResourceUtils.getNavbarSize("navigation_bar_width", resources); if (dp.isSeascape()) { @@ -116,7 +117,9 @@ public class LauncherRootView extends InsettableFrameLayout { } } } else { - newNavInsets.bottom = ResourceUtils.getNavbarSize("navigation_bar_height", resources); + newNavInsets.bottom = dp.isTaskbarPresent + ? 0 + : ResourceUtils.getNavbarSize("navigation_bar_height", resources); } updatedInsetsBuilder.setInsets(WindowInsets.Type.navigationBars(), Insets.of(newNavInsets)); updatedInsetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(),