From e9e5e51d732050aa6d547effbb9976b899186231 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Mon, 28 Jun 2021 21:53:09 -0700 Subject: [PATCH] [Live Tile] App surface is above launcher even after reaching Overview Currently we place app surface below launcher and punch a hole through task view to display live tile in overview. In this change the order will be flipped, with a few benefits not limited to the following. For example, we have a surface view lifecycle bug where the surface view in a live tile app can go blank during app launch transition. This change will significantly mitigate the issue visually as the background wallpaper will not be revealed. In order to make sure visually everything still looks the same, we will need to finish the recents animation when the user taps on the task view icon, since the menu overlaps with the task snapshort view. This change also addresses fading out the task view when it's getting dismissed. Test: manual Fixes: 186531762 Fixes: 189265196 Change-Id: Ieae67fb89b60136fd81ceb8abde1a0cab8718b27 --- .../quickstep/util/TaskViewSimulator.java | 12 ------------ .../android/quickstep/views/RecentsView.java | 8 ++++++-- .../android/quickstep/views/TaskMenuView.java | 13 +------------ .../quickstep/views/TaskThumbnailView.java | 3 --- .../com/android/quickstep/views/TaskView.java | 17 ++++++++++------- 5 files changed, 17 insertions(+), 36 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 0e6ce87042..7eee415315 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -17,7 +17,6 @@ package com.android.quickstep.util; import static com.android.launcher3.states.RotationHelper.deltaRotation; import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE; -import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE; import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation; import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; @@ -62,7 +61,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { private final boolean mIsRecentsRtl; private final Rect mTaskRect = new Rect(); - private boolean mDrawsBelowRecents; private final PointF mPivot = new PointF(); private DeviceProfile mDp; @@ -163,10 +161,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { recentsViewScroll.value = scroll; } - public void setDrawsBelowRecents(boolean drawsBelowRecents) { - mDrawsBelowRecents = drawsBelowRecents; - } - /** * Adds animation for all the components corresponding to transition from an app to overview. */ @@ -301,12 +295,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { builder.withMatrix(mMatrix) .withWindowCrop(mTmpCropRect) .withCornerRadius(getCurrentCornerRadius()); - - if (LIVE_TILE.get() && params.getRecentsSurface() != null) { - // When relativeLayer = 0, it reverts the surfaces back to the original order. - builder.withRelativeLayerTo(params.getRecentsSurface(), - mDrawsBelowRecents ? Integer.MIN_VALUE : 0); - } } /** diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 0e3ccae42f..6b62bc3fb9 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -638,7 +638,6 @@ public abstract class RecentsView { - if (LIVE_TILE.get()) { - RecentsView recentsView = mTaskView.getRecentsView(); - recentsView.switchToScreenshot(null, - () -> recentsView.finishRecentsAnimation(true /* toRecents */, - false /* shouldPip */, - () -> menuOption.onClick(view))); - } else { - menuOption.onClick(view); - } - }); + menuOptionView.setOnClickListener(menuOption::onClick); mOptionLayout.addView(menuOptionView); } diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index df195d75b1..ee6b94b4f6 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -84,7 +84,6 @@ public class TaskThumbnailView extends View implements PluginListener showTaskMenu()); + mIconView.setOnClickListener(v -> { + if (LIVE_TILE.get() && isRunningTask()) { + RecentsView recentsView = getRecentsView(); + recentsView.switchToScreenshot( + () -> recentsView.finishRecentsAnimation(true /* toRecents */, + this::showTaskMenu)); + } else { + showTaskMenu(); + } + }); mIconView.setOnLongClickListener(v -> { requestDisallowInterceptTouchEvent(true); return showTaskMenu();