summaryrefslogtreecommitdiff
path: root/quickstep
diff options
context:
space:
mode:
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/AndroidManifest-launcher.xml2
-rw-r--r--quickstep/res/drawable/ic_clear_all.xml22
-rw-r--r--quickstep/res/drawable/task_menu_item_bg.xml15
-rw-r--r--quickstep/res/layout/overview_actions_container.xml14
-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
14 files changed, 110 insertions, 19 deletions
diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml
index 53910e344b..f249276400 100644
--- a/quickstep/AndroidManifest-launcher.xml
+++ b/quickstep/AndroidManifest-launcher.xml
@@ -43,7 +43,7 @@
attributes and intent filters the same
-->
<activity
- android:name="com.android.launcher3.uioverrides.QuickstepLauncher"
+ android:name="com.android.launcher3.CustomLauncher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
diff --git a/quickstep/res/drawable/ic_clear_all.xml b/quickstep/res/drawable/ic_clear_all.xml
new file mode 100644
index 0000000000..09a8e06a7b
--- /dev/null
+++ b/quickstep/res/drawable/ic_clear_all.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="#FF000000" android:pathData="M5,13H19V11H5M3,17H17V15H3M7,7V9H21V7" />
+</vector>
diff --git a/quickstep/res/drawable/task_menu_item_bg.xml b/quickstep/res/drawable/task_menu_item_bg.xml
index 16c13ebebc..bd863f2bc4 100644
--- a/quickstep/res/drawable/task_menu_item_bg.xml
+++ b/quickstep/res/drawable/task_menu_item_bg.xml
@@ -15,8 +15,13 @@
limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <solid android:color="?androidprv:attr/colorSurface" />
- <corners android:radius="@dimen/task_menu_item_corner_radius" />
-</shape>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item>
+ <shape>
+ <solid android:color="?androidprv:attr/colorSurface" />
+ <corners android:radius="@dimen/task_menu_item_corner_radius" />
+ </shape>
+ </item>
+</ripple>
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index 0fda0bf8d4..35f59dfce3 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -41,6 +41,20 @@
android:theme="@style/ThemeControlHighlightWorkspaceColor" />
<Space
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:id="@+id/action_clear_all"
+ style="@style/OverviewActionButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableStart="@drawable/ic_clear_all"
+ android:text="@string/recents_clear_all"
+ android:theme="@style/ThemeControlHighlightWorkspaceColor" />
+
+ <Space
android:id="@+id/action_split_space"
android:layout_width="@dimen/overview_actions_button_spacing"
android:layout_height="1dp"
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 =