summaryrefslogtreecommitdiffstats
path: root/quickstep/src/com/android/quickstep
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-11-12 17:19:36 -0800
committerTony Wickham <twickham@google.com>2018-11-13 15:31:57 -0800
commitbdc5f3d9e695483e6399ffe193e5349d0a59682e (patch)
tree02f434752f8ebd10b42a553cced2257fcfec66a6 /quickstep/src/com/android/quickstep
parent9d9310ba728961ef4a858a91b98e373b0545db74 (diff)
downloadandroid_packages_apps_Trebuchet-bdc5f3d9e695483e6399ffe193e5349d0a59682e.tar.gz
android_packages_apps_Trebuchet-bdc5f3d9e695483e6399ffe193e5349d0a59682e.tar.bz2
android_packages_apps_Trebuchet-bdc5f3d9e695483e6399ffe193e5349d0a59682e.zip
Fix quick switch when swiping right on back button
Deferring the window tracking when touching down on the back button means that we don't set isQuickSwitch before setting the state to FAST_OVERVIEW, making it not scale up to be full screen. To fix this, we reapply the state when preparing QuickScrubController for quick switch. Change-Id: Ib3dcf300c45a00673ff9337f98d16d4e8cdf1ea0
Diffstat (limited to 'quickstep/src/com/android/quickstep')
-rw-r--r--quickstep/src/com/android/quickstep/ActivityControlHelper.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
index 85eed1fbf..02af0d65c 100644
--- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java
+++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
@@ -29,7 +29,6 @@ import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_BACK;
import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_ROTATION;
-
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
@@ -44,7 +43,8 @@ import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
-
+import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -77,9 +77,6 @@ import java.util.Objects;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
-import androidx.annotation.Nullable;
-import androidx.annotation.UiThread;
-
/**
* Utility class which abstracts out the logical differences between Launcher and RecentsActivity.
*/
@@ -156,10 +153,21 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
public void onQuickInteractionStart(Launcher activity, RunningTaskInfo taskInfo,
boolean activityVisible, TouchInteractionLog touchInteractionLog) {
LauncherState fromState = activity.getStateManager().getState();
- activity.getStateManager().goToState(FAST_OVERVIEW, activityVisible);
-
QuickScrubController controller = activity.<RecentsView>getOverviewPanel()
.getQuickScrubController();
+ boolean isQuickSwitch = controller.isQuickSwitch();
+ boolean animate = activityVisible;
+ if (isQuickSwitch && fromState == FAST_OVERVIEW && !animate) {
+ // We can already be in FAST_OVERVIEW if createActivityController() was called
+ // before us. This could happen, for instance, when launcher is slow to load when
+ // starting quick switch, causing us to call onQuickScrubStart() on the background
+ // thread. In this case, we also hadn't set isQuickSwitch = true before setting
+ // FAST_OVERVIEW, so we need to reapply FAST_OVERVIEW to take that into account.
+ activity.getStateManager().reapplyState();
+ } else {
+ activity.getStateManager().goToState(FAST_OVERVIEW, animate);
+ }
+
controller.onQuickScrubStart(activityVisible && !fromState.overviewUi, this,
touchInteractionLog);