summaryrefslogtreecommitdiff
path: root/quickstep/src
diff options
context:
space:
mode:
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/launcher3/CustomLauncher.java29
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java1
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java2
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java2
-rw-r--r--quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java8
-rw-r--r--quickstep/src/com/android/quickstep/LauncherActivityInterface.java2
-rw-r--r--quickstep/src/com/android/quickstep/TaskOverlayFactory.java14
-rw-r--r--quickstep/src/com/android/quickstep/fallback/RecentsState.java2
-rw-r--r--quickstep/src/com/android/quickstep/views/OverviewActionsView.java5
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java11
10 files changed, 63 insertions, 13 deletions
diff --git a/quickstep/src/com/android/launcher3/CustomLauncher.java b/quickstep/src/com/android/launcher3/CustomLauncher.java
new file mode 100644
index 0000000000..1e41f42436
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/CustomLauncher.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 Paranoid Android
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.systemui.plugins.shared.LauncherOverlayManager;
+
+public class CustomLauncher extends QuickstepLauncher {
+
+ @Override
+ protected LauncherOverlayManager getDefaultOverlay() {
+ return new OverlayCallbackImpl(this);
+ }
+
+}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index b7330072d4..3e737bb6f3 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -73,7 +73,6 @@ public class BackgroundAppState extends OverviewState {
public int getVisibleElements(Launcher launcher) {
return super.getVisibleElements(launcher)
& ~OVERVIEW_ACTIONS
- & ~CLEAR_ALL_BUTTON
& ~VERTICAL_SWIPE_INDICATOR;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
index 6f084a1f97..8ffdf176c1 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
@@ -46,7 +46,7 @@ public class OverviewModalTaskState extends OverviewState {
@Override
public int getVisibleElements(Launcher launcher) {
- return OVERVIEW_ACTIONS | CLEAR_ALL_BUTTON;
+ return OVERVIEW_ACTIONS;
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index 08d0a80f03..56cbefc427 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -88,7 +88,7 @@ public class OverviewState extends LauncherState {
@Override
public int getVisibleElements(Launcher launcher) {
- return CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
+ return OVERVIEW_ACTIONS;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 9f1e47f15a..d170f75b9a 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -424,12 +424,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
HashMap<Integer, ThumbnailData> snapshots =
mGestureState.consumeRecentsAnimationCanceledSnapshot();
if (snapshots != null) {
- mRecentsView.switchToScreenshot(snapshots, () -> {
- if (mRecentsAnimationController != null) {
- mRecentsAnimationController.cleanupScreenshot();
- }
- });
mRecentsView.onRecentsAnimationComplete();
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.cleanupScreenshot();
+ }
}
});
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index 719c2ae78c..8875f6d942 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -234,7 +234,7 @@ public final class LauncherActivityInterface extends
@Override
public void onStateTransitionComplete(LauncherState toState) {
// Are we going from Recents to Workspace?
- if (toState == LauncherState.NORMAL) {
+ if (toState == LauncherState.NORMAL || toState == LauncherState.ALL_APPS) {
exitRunnable.run();
notifyRecentsOfOrientation(deviceState);
stateManager.removeStateListener(this);
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 276e1c2a6f..208ba7efc9 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -249,6 +249,11 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
overviewPanel.initiateSplitSelect(mThumbnailView.getTaskView());
}
+ private void clearAllTasks() {
+ final RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView();
+ recentsView.dismissAllTasks();
+ }
+
/**
* Called when the overlay is no longer used.
*/
@@ -343,13 +348,20 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
}
@SuppressLint("NewApi")
+ @Override
public void onScreenshot() {
endLiveTileMode(() -> saveScreenshot(mTask));
}
+ @Override
public void onSplit() {
endLiveTileMode(TaskOverlay.this::enterSplitSelect);
}
+
+ @Override
+ public void onClearAllTasksRequested() {
+ endLiveTileMode(TaskOverlay.this::clearAllTasks);
+ }
}
}
@@ -363,5 +375,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
/** User wants to start split screen with current app. */
void onSplit();
+
+ void onClearAllTasksRequested();
}
}
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index 15feb18367..dcd172170b 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -102,7 +102,7 @@ public class RecentsState implements BaseState<RecentsState> {
* For this state, whether clear all button should be shown.
*/
public boolean hasClearAllButton() {
- return hasFlag(FLAG_CLEAR_ALL_BUTTON);
+ return false;
}
/**
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 029482892d..783f677f5d 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -115,6 +115,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
protected void onFinishInflate() {
super.onFinishInflate();
findViewById(R.id.action_screenshot).setOnClickListener(this);
+ findViewById(R.id.action_clear_all).setOnClickListener(this);
mSplitButton = findViewById(R.id.action_split);
mSplitButton.setOnClickListener(this);
@@ -134,11 +135,13 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
if (mCallbacks == null) {
return;
}
- int id = view.getId();
+ final int id = view.getId();
if (id == R.id.action_screenshot) {
mCallbacks.onScreenshot();
} else if (id == R.id.action_split) {
mCallbacks.onSplit();
+ } else if (id == R.id.action_clear_all) {
+ mCallbacks.onClearAllTasksRequested();
}
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 02261af499..c8bbf43619 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3426,6 +3426,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mActivity.getStatsLogManager().logger().log(LAUNCHER_TASK_CLEAR_ALL);
}
+ public void dismissAllTasks() {
+ dismissAllTasks(null);
+ }
+
private void dismissCurrentTask() {
TaskView taskView = getNextPageTaskView();
if (taskView != null) {
@@ -3962,6 +3966,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.getActiveSplitStagePosition(), firstTaskEndingBounds,
secondTaskEndingBounds);
+ if (mFirstFloatingTaskView == null) return;
mFirstFloatingTaskView.getBoundsOnScreen(firstTaskStartingBounds);
mFirstFloatingTaskView.addAnimation(pendingAnimation,
new RectF(firstTaskStartingBounds), firstTaskEndingBounds, mFirstFloatingTaskView,
@@ -4035,8 +4040,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.getActiveSplitStagePosition(), mTempRect);
mTempRectF.set(mTempRect);
// TODO(194414938) set correct corner radius
- mFirstFloatingTaskView.updateOrientationHandler(mOrientationHandler);
- mFirstFloatingTaskView.update(mTempRectF, /*progress=*/1f, /*windowRadius=*/0f);
+ if (mFirstFloatingTaskView != null) {
+ mFirstFloatingTaskView.updateOrientationHandler(mOrientationHandler);
+ mFirstFloatingTaskView.update(mTempRectF, /*progress=*/1f, /*windowRadius=*/0f);
+ }
PagedOrientationHandler orientationHandler = getPagedOrientationHandler();
Pair<FloatProperty, FloatProperty> taskViewsFloat =