summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides/src/com/android/quickstep
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2019-10-04 12:55:22 -0700
committerTony Wickham <twickham@google.com>2019-10-07 21:08:04 +0000
commitaf33f2c9d4063c2ad95a92777cbd5e66d81d3fab (patch)
tree35575812ab0cb35e417babce60aff30a0ddfa4ec /quickstep/recents_ui_overrides/src/com/android/quickstep
parentaf754b9a9af47448916a4382aeaedd2e93c3b599 (diff)
downloadandroid_packages_apps_Trebuchet-af33f2c9d4063c2ad95a92777cbd5e66d81d3fab.tar.gz
android_packages_apps_Trebuchet-af33f2c9d4063c2ad95a92777cbd5e66d81d3fab.tar.bz2
android_packages_apps_Trebuchet-af33f2c9d4063c2ad95a92777cbd5e66d81d3fab.zip
Fix quickswitch flickers/ignored swipes
- Don't set current page to running task when applying load plan, if we are already settling on a new task to launch. - When starting a new task, finish to the running app if that's the task being started (should not happen with above change) - When disabling free scroll mode, don't snap to a page if we're already on it. This was setting mNextPage so the first check was falsing. Bug: 142068081 Change-Id: I5b392d9726a81c51718d2f94eee6cd4f78b61f69
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java10
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java14
2 files changed, 17 insertions, 7 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 411a8088c..c80dede53 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -922,7 +922,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
windowAnim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
- setStateOnUiThread(target.endState);
+ if (target == NEW_TASK && mRecentsView != null
+ && mRecentsView.getNextPage() == mRecentsView.getRunningTaskIndex()) {
+ // We are about to launch the current running task, so use LAST_TASK state
+ // instead of NEW_TASK. This could happen, for example, if our scroll is
+ // aborted after we determined the target to be NEW_TASK.
+ setStateOnUiThread(LAST_TASK.endState);
+ } else {
+ setStateOnUiThread(target.endState);
+ }
}
});
windowAnim.start();
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index 554f4372c..02c43e4ad 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -17,7 +17,6 @@
package com.android.quickstep.views;
import static androidx.dynamicanimation.animation.DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS;
-
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
@@ -573,11 +572,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
taskView.bind(task);
}
- TaskView runningTaskView = getRunningTaskView();
- if (runningTaskView != null) {
- setCurrentPage(indexOfChild(runningTaskView));
- } else if (getTaskViewCount() > 0) {
- setCurrentPage(indexOfChild(getTaskViewAt(0)));
+ if (mNextPage == INVALID_PAGE) {
+ // Set the current page to the running task, but not if settling on new task.
+ TaskView runningTaskView = getRunningTaskView();
+ if (runningTaskView != null) {
+ setCurrentPage(indexOfChild(runningTaskView));
+ } else if (getTaskViewCount() > 0) {
+ setCurrentPage(indexOfChild(getTaskViewAt(0)));
+ }
}
if (mIgnoreResetTaskId != -1 && getTaskView(mIgnoreResetTaskId) != ignoreResetTaskView) {