From 798644d1f1401a2840991b9260207b20952ff922 Mon Sep 17 00:00:00 2001 From: Jordan Silva Date: Fri, 8 Mar 2024 13:10:42 +0000 Subject: [PATCH 1/3] Fix overview live tile flickers when clicking on overview action buttons When a Live Tile is present on overview and an action is triggered (e.g., Split, Select, Screenshot), the live tile flickers due to a competing snapshot modification and animation on UI thread. The live tile is updated to switch to screenshot and at the same time the finishRecentsAnimation is triggered. This CL bumps the number of frames to wait after the view is updated to run the Runnable code. Bumping back the mDeferFrameCount to 2 solves the sync between rendering the snapshot and hiding the Live Tile. Fix: 327380570 Flag: N/A Test: Manual. Open an App -> Swipe to Overview (Live title) -> Click on Split. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:024a1018e4c96b43d8f122bb1c614c3e3ea5bab7) Merged-In: Ibd22a58580b2e5e5b866deb4e7dc87945c7e38c4 Change-Id: Ibd22a58580b2e5e5b866deb4e7dc87945c7e38c4 --- quickstep/src/com/android/quickstep/ViewUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/ViewUtils.java b/quickstep/src/com/android/quickstep/ViewUtils.java index b1320674e6..3b58dfcb39 100644 --- a/quickstep/src/com/android/quickstep/ViewUtils.java +++ b/quickstep/src/com/android/quickstep/ViewUtils.java @@ -56,7 +56,7 @@ public class ViewUtils { boolean mSurfaceCallbackRegistered = false; boolean mFinished; - int mDeferFrameCount = 1; + int mDeferFrameCount = 2; FrameHandler(View view, Runnable finishCallback, BooleanSupplier cancelled) { mViewRoot = view.getViewRootImpl(); From 514185537a2144313918ae9e7d8061331859b3e8 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 11 Mar 2024 16:53:39 -0700 Subject: [PATCH 2/3] Update Launcher state anim duration for pinned & transient taskbar * We were syncing the duration of the animation to be at most that of the taskbar/hotseat animation but only for transient taskbar. * Now we sync for transient and pinned Fixes: 328052756 Test: Anim jank doesn't repro (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9a3c48468b35377ef46bf2b362f68c467ecd45ad) Merged-In: I21f20cbc08a2018498dde3eff871929e5a5b7d7d Change-Id: I21f20cbc08a2018498dde3eff871929e5a5b7d7d --- .../uioverrides/states/QuickstepAtomicAnimationFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 72218bf26e..8c92c7db49 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -135,8 +135,7 @@ public class QuickstepAtomicAnimationFactory extends config.duration = Math.max(config.duration, scrollDuration); // Sync scroll so that it ends before or at the same time as the taskbar animation. - if (DisplayController.isTransientTaskbar(mActivity) - && mActivity.getDeviceProfile().isTaskbarPresent) { + if (mActivity.getDeviceProfile().isTaskbarPresent) { config.duration = Math.min(config.duration, TASKBAR_TO_HOME_DURATION); } overview.snapToPage(DEFAULT_PAGE, Math.toIntExact(config.duration)); From 0425766b1ab39d0e6e820e6a9da787a8349b04de Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 12 Mar 2024 17:48:33 +0000 Subject: [PATCH 3/3] Allow Task menu to draw down to screen bottom - Use all available spaces minus inset to draw the task menu - Also enabled scrolling for app chi1p menu Fix: 329271577 Bug: 326952853 Test: manual Flag: Nonee (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:26e487c6acd86c668518d379f90cb84f3d89a486) Merged-In: Ibdff07043f2c64495f97e11e80209bcc3f5dcb4f Change-Id: Ibdff07043f2c64495f97e11e80209bcc3f5dcb4f --- .../orientation/LandscapePagedViewHandler.java | 6 ++++++ .../orientation/PortraitPagedViewHandler.java | 6 ++++++ .../orientation/RecentsPagedOrientationHandler.java | 3 +++ .../orientation/SeascapePagedViewHandler.java | 6 ++++++ .../com/android/quickstep/views/TaskMenuView.java | 13 +++++-------- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.java b/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.java index 8648b56072..f345aebb0c 100644 --- a/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.java +++ b/quickstep/src/com/android/quickstep/orientation/LandscapePagedViewHandler.java @@ -304,6 +304,12 @@ public class LandscapePagedViewHandler implements RecentsPagedOrientationHandler } } + @Override + public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, + float taskMenuX, float taskMenuY) { + return (int) (taskMenuX - taskInsetMargin); + } + @Override public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile, LinearLayout taskMenuLayout, int dividerSpacing, diff --git a/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java b/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java index 60e6a255cb..5cd97763d1 100644 --- a/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java +++ b/quickstep/src/com/android/quickstep/orientation/PortraitPagedViewHandler.java @@ -209,6 +209,12 @@ public class PortraitPagedViewHandler extends DefaultPagedViewHandler implements : thumbnailView.getMeasuredWidth()) - (2 * padding); } + @Override + public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, + float taskMenuX, float taskMenuY) { + return (int) (deviceProfile.availableHeightPx - taskInsetMargin - taskMenuY); + } + @Override public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile, LinearLayout taskMenuLayout, int dividerSpacing, diff --git a/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.java b/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.java index 01c1225c40..4b65d53172 100644 --- a/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.java +++ b/quickstep/src/com/android/quickstep/orientation/RecentsPagedOrientationHandler.java @@ -176,6 +176,9 @@ public interface RecentsPagedOrientationHandler extends PagedOrientationHandler View taskMenuView, float taskInsetMargin, View taskViewIcon); int getTaskMenuWidth(View thumbnailView, DeviceProfile deviceProfile, @StagePosition int stagePosition); + + int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, float taskMenuX, + float taskMenuY); /** * Sets linear layout orientation for {@link com.android.launcher3.popup.SystemShortcut} items * inside task menu view. diff --git a/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.java b/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.java index a964639e41..89c678c114 100644 --- a/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.java +++ b/quickstep/src/com/android/quickstep/orientation/SeascapePagedViewHandler.java @@ -113,6 +113,12 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { } } + @Override + public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, + float taskMenuX, float taskMenuY) { + return (int) (deviceProfile.availableWidthPx - taskInsetMargin - taskMenuX); + } + @Override public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect, SplitBounds splitInfo, int desiredStagePosition) { diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java index 137455e23a..c9aad1a4d6 100644 --- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java +++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java @@ -140,11 +140,9 @@ public class TaskMenuView extends AbstractFloatingView { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - if (!enableOverviewIconMenu()) { - int maxMenuHeight = calculateMaxHeight(); - if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) { - heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST); - } + int maxMenuHeight = calculateMaxHeight(); + if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) { + heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } @@ -416,10 +414,9 @@ public class TaskMenuView extends AbstractFloatingView { * with a margin on the top and bottom. */ private int calculateMaxHeight() { - float taskBottom = mTaskView.getHeight() + mTaskView.getPersistentTranslationY(); float taskInsetMargin = getResources().getDimension(R.dimen.task_card_margin); - - return (int) (taskBottom - taskInsetMargin - getTranslationY()); + return mTaskView.getPagedOrientationHandler().getTaskMenuHeight(taskInsetMargin, + mActivity.getDeviceProfile(), getTranslationX(), getTranslationY()); } private void setOnClosingStartCallback(Runnable onClosingStartCallback) {