Merge "Immediately close taskbar all apps on swipe up gesture." into tm-dev

This commit is contained in:
Brian Isganitis
2022-03-07 17:52:22 +00:00
committed by Android (Google) Code Review
5 changed files with 20 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.InstanceIdSequence;
import com.android.launcher3.model.data.ItemInfo;

View File

@@ -68,4 +68,11 @@ public class TaskbarUIController {
public void setSystemGestureInProgress(boolean inProgress) {
mControllers.taskbarStashController.setSystemGestureInProgress(inProgress);
}
/**
* Manually closes the all apps window.
*/
public void hideAllApps() {
mControllers.taskbarAllAppsController.hide();
}
}

View File

@@ -131,6 +131,11 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList
.setPredictedApps(mPredictedApps);
}
/** Closes the {@link TaskbarAllAppsContainerView}. */
public void hide() {
mProxyView.close(true);
}
/**
* Removes the all apps window from the hierarchy, if all floating views are closed and there is
* no system drag operation in progress.

View File

@@ -69,6 +69,7 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import java.util.HashMap;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -193,7 +194,12 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
activity.getStateManager().moveToRestState();
}
public void closeOverlay() { }
/**
* Closes any overlays.
*/
public void closeOverlay() {
Optional.ofNullable(getTaskbarController()).ifPresent(TaskbarUIController::hideAllApps);
}
public void switchRunningTaskViewToScreenshot(HashMap<Integer, ThumbnailData> thumbnailDatas,
Runnable runnable) {

View File

@@ -280,6 +280,7 @@ public final class LauncherActivityInterface extends
@Override
public void closeOverlay() {
super.closeOverlay();
Launcher launcher = getCreatedActivity();
if (launcher == null) {
return;