From d2fffa6ea504f8f74995d54c7c5d91c168fc1b95 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 18 Jun 2020 19:57:43 -0500 Subject: [PATCH] Inline TaskView#resetVisualProperties() into RecentsView - This was only used in RecentsView#resetTaskVisuals() anyway - Previously resetVisualProperties() just called resetViewTransforms() plus setFullscreenProgress(0) and setModalness(0) - The latter 2, specificially setFullscreenProgress(0) led to problems such as the bug below. Instead, we should reset to the current mFullscreenProgress and mTaskModalness. Bug: task view sometimes shifted up during quick switch Steps: - Do the quick switch gesture very quickly - At the start of the gesture, we call getTasks(), which calls applyLoadPlan() asynchronously - applyLoadPlan() calls resetTaskVisuals(), so if this happened after the gesture ended, we would setFullscreenProgress(0) on all the task views, hence the upwards shift (if the gesture was still in progress, it would reapply the real fullscreen progress) Fixes: 157105795 Change-Id: Idb9d91ff89701d726838b47f955d4300f5ef13bd --- .../src/com/android/quickstep/views/RecentsView.java | 4 +++- .../src/com/android/quickstep/views/TaskView.java | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) 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 873c672625..fc50845894 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 @@ -791,8 +791,10 @@ public abstract class RecentsView extends PagedView impl for (int i = getTaskViewCount() - 1; i >= 0; i--) { TaskView taskView = getTaskViewAt(i); if (mIgnoreResetTaskId != taskView.getTask().key.id) { - taskView.resetVisualProperties(); + taskView.resetViewTransforms(); taskView.setStableAlpha(mContentAlpha); + taskView.setFullscreenProgress(mFullscreenProgress); + taskView.setModalness(mTaskModalness); } } if (mRunningTaskTileHidden) { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java index 3b1210e2ae..be2e2345a7 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java @@ -543,7 +543,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { setIconAndDimTransitionProgress(iconScale, invert); } - private void resetViewTransforms() { + protected void resetViewTransforms() { setCurveScale(1); setTranslationX(0f); setTranslationY(0f); @@ -552,12 +552,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { setIconScaleAndDim(1); } - public void resetVisualProperties() { - resetViewTransforms(); - setFullscreenProgress(0); - setModalness(0); - } - public void setStableAlpha(float parentAlpha) { mStableAlpha = parentAlpha; setAlpha(mStableAlpha);