diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java index 2efbd4fa37..743619b6be 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java @@ -93,6 +93,12 @@ public class TaskbarDragLayerController { */ public void updateInsetsTouchability(InsetsInfo insetsInfo) { insetsInfo.touchableRegion.setEmpty(); + if (mActivity.canShowNavButtons()) { + // Always have nav buttons be touchable + mControllers.navbarButtonsViewController.addVisibleButtonsRegion( + mTaskbarDragLayer, insetsInfo.touchableRegion); + } + if (mTaskbarDragLayer.getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD) { // Let touches pass through us. insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); @@ -105,8 +111,6 @@ public class TaskbarDragLayerController { // Buttons are visible, take over the full taskbar area insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_FRAME); } else { - mControllers.navbarButtonsViewController.addVisibleButtonsRegion( - mTaskbarDragLayer, insetsInfo.touchableRegion); insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java index 002d42da3b..8549ca2ac5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java @@ -94,8 +94,10 @@ public class TaskbarNavButtonController { } private void navigateToOverview() { - mService.getOverviewCommandHelper() - .addCommand(OverviewCommandHelper.TYPE_SHOW); + int commandType = mService.getOverviewCommandHelper().isOverviewVisible() ? + OverviewCommandHelper.TYPE_TOGGLE : + OverviewCommandHelper.TYPE_SHOW; + mService.getOverviewCommandHelper().addCommand(commandType); } private void executeBack() { diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index dbdd75fc13..b06c1ca8f1 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -136,6 +136,11 @@ public class OverviewCommandHelper { } } + public boolean isOverviewVisible() { + BaseActivityInterface activityInterface = + mOverviewComponentObserver.getActivityInterface(); + return activityInterface.getVisibleRecentsView() != null; + } /** * Executes the task and returns true if next task can be executed. If false, then the next * task is deferred until {@link #scheduleNextTask} is called