From dcd76d56c74cbb13d3226f7981e8621979dd01e0 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Fri, 23 Aug 2024 16:43:37 -0700 Subject: [PATCH] Fixed issue with the bottom zone of launcher is not touchable. Updated logic of the touch area configuration. Only add the taskbar bounds if the taskbar is being shown inside the app or on overview. Fixes: 358301278 Fixes: 361653416 Test: Manual: http: //recall/-/gx8ASgewUeUS3QYohfrd1J/lpzJER3iGI5PpZrQqv7b7 Flag: com.android.wm.shell.enable_bubble_bar Change-Id: Id9902058c5ec873dab6257a34b4c3a87aec5ae6b --- .../launcher3/taskbar/TaskbarInsetsController.kt | 14 ++++++-------- .../launcher3/taskbar/TaskbarStashController.java | 5 +++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt index ff1ea98f1b..221504dd64 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt @@ -56,7 +56,6 @@ import com.android.launcher3.util.DisplayController import com.android.launcher3.util.Executors import java.io.PrintWriter import kotlin.jvm.optionals.getOrNull -import kotlin.math.max /** Handles the insets that Taskbar provides to underlying apps and the IME. */ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTaskbarController { @@ -106,7 +105,8 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas } fun onTaskbarOrBubblebarWindowHeightOrInsetsChanged() { - val tappableHeight = controllers.taskbarStashController.tappableHeightToReportToApps + val taskbarStashController = controllers.taskbarStashController + val tappableHeight = taskbarStashController.tappableHeightToReportToApps // We only report tappableElement height for unstashed, persistent taskbar, // which is also when we draw the rounded corners above taskbar. val insetsRoundedCornerFlag = @@ -133,7 +133,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas } val bubbleControllers = controllers.bubbleControllers.getOrNull() - val taskbarTouchableHeight = controllers.taskbarStashController.touchableHeight + val taskbarTouchableHeight = taskbarStashController.touchableHeight val bubblesTouchableHeight = bubbleControllers?.bubbleStashController?.getTouchableHeight() ?: 0 // reset touch bounds @@ -147,12 +147,10 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.bubbleBarBounds) } } - val taskbarUIController = controllers.uiController as? LauncherTaskbarUIController - if (taskbarUIController?.isOnHome != true) { - // only add the bars touch region if not on home - val touchableHeight = max(taskbarTouchableHeight, bubblesTouchableHeight) + if (taskbarStashController.isInApp || taskbarStashController.isInOverview) { + // only add the taskbar touch region if not on home val bottom = windowLayoutParams.height - val top = bottom - touchableHeight + val top = bottom - taskbarTouchableHeight val right = context.deviceProfile.widthPx defaultTouchableRegion.addBoundsToRegion(Rect(/* left= */ 0, top, right, bottom)) } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index b48ed603f7..56f88d12f5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -424,6 +424,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba return hasAnyFlag(FLAGS_IN_APP); } + /** Returns whether the taskbar is currently in overview screen. */ + public boolean isInOverview() { + return hasAnyFlag(FLAG_IN_OVERVIEW); + } + /** * Returns the height that taskbar will be touchable. */