Merge "Tap on recents button twice to go to last app" into sc-v2-dev am: 9cc7c45b7f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14985087

Change-Id: I33287662626ab0cef3d98bf96a60f283e7ede8f9
This commit is contained in:
TreeHugger Robot
2021-06-16 07:30:38 +00:00
committed by Automerger Merge Worker
3 changed files with 15 additions and 4 deletions
@@ -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);
}
}
@@ -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() {
@@ -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