From 8af853ab60a16127b29745ac4b9bfbc4894f8617 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Mon, 17 Mar 2025 22:30:21 +0000 Subject: [PATCH 01/21] Change A-Z font to GSF for app icons and PS header Used com.android.launcher3.gsf_res flag to control font changes in launcher. Tested font changes manually only to App icons, PS header, and PS lock text. bug:393609630 Test: manually: AA and flag Off: https://hsv.googleplex.com/6005345892696064 AA and flag On: https://hsv.googleplex.com/5713302612082688 AA and flag Off w/ TwoLine: https://hsv.googleplex.com/6604407931142144 AA and flag On w/ TwoLine: https://hsv.googleplex.com/5006326877913088 PS and flag off: https://hsv.googleplex.com/6253491923189760 PS and flag on: https://hsv.googleplex.com/4909373317971968 Flag: com.android.launcher3.gsf_res Change-Id: Icae71ae648340ac566a908648eae14985b6aa4d3 --- res/layout/private_space_header.xml | 2 +- res/values/styles.xml | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/res/layout/private_space_header.xml b/res/layout/private_space_header.xml index 29da5aaf44..db11d7bff2 100644 --- a/res/layout/private_space_header.xml +++ b/res/layout/private_space_header.xml @@ -75,7 +75,7 @@ android:maxLines="1" android:visibility="gone" android:alpha="0" - style="@style/TextHeadline"/> + style="@style/PrivateSpaceLockTextStyle"/> @animator/all_apps_fastscroll_icon_anim @dimen/dynamic_grid_cell_padding_x @dimen/dynamic_grid_cell_padding_x + + variable-title-small + @@ -440,7 +443,18 @@ + + From e8b7cd7b2eb7dec79355419a82c827ad5bfe9a3c Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Wed, 19 Mar 2025 14:04:23 -0400 Subject: [PATCH 02/21] Use up-to-date hover tooltip text for recents. Flag: EXEMPT bugfix Fix: 402776493 Test: go/testedequals Change-Id: I6f438ce8b3cd51beaece0cf6734876f21719bf3d --- .../TaskbarHoverToolTipController.java | 35 +++++++++++-------- .../launcher3/taskbar/TaskbarView.java | 2 +- .../TaskbarHoverToolTipControllerTest.kt | 9 +++++ src/com/android/launcher3/BubbleTextView.java | 6 ++-- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java index 76489e0fa1..63d98d64a5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java @@ -26,6 +26,7 @@ import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLA import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.graphics.Rect; +import android.text.TextUtils; import android.view.ContextThemeWrapper; import android.view.MotionEvent; import android.view.View; @@ -50,7 +51,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { private final TaskbarView mTaskbarView; private final View mHoverView; private final ArrowTipView mHoverToolTipView; - private final String mToolTipText; private final int mYOffset; public TaskbarHoverToolTipController(TaskbarActivityContext activity, TaskbarView taskbarView, @@ -59,17 +59,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { mTaskbarView = taskbarView; mHoverView = hoverView; - if (mHoverView instanceof BubbleTextView) { - mToolTipText = ((BubbleTextView) mHoverView).getText().toString(); - } else if (mHoverView instanceof FolderIcon - && ((FolderIcon) mHoverView).mInfo.title != null) { - mToolTipText = ((FolderIcon) mHoverView).mInfo.title.toString(); - } else if (mHoverView instanceof AppPairIcon) { - mToolTipText = ((AppPairIcon) mHoverView).getTitleTextView().getText().toString(); - } else { - mToolTipText = null; - } - ContextThemeWrapper arrowContextWrapper = new ContextThemeWrapper(mActivity, R.style.ArrowTipTaskbarStyle); mHoverToolTipView = new ArrowTipView(arrowContextWrapper, /* isPointingUp = */ false, @@ -111,9 +100,15 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { } private void maybeRevealHoverToolTip() { - if (mHoverView == null || mToolTipText == null) { + if (mHoverView == null) { return; } + + final String toolTipText = getToolTipText(); + if (TextUtils.isEmpty(toolTipText)) { + return; + } + // Do not show tooltip if taskbar icons are transitioning to hotseat. if (mActivity.isIconAlignedWithHotseat()) { return; @@ -128,7 +123,19 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { } Rect iconViewBounds = Utilities.getViewBounds(mHoverView); - mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(), + mHoverToolTipView.showAtLocation(toolTipText, iconViewBounds.centerX(), mTaskbarView.getTop() - mYOffset, /* shouldAutoClose= */ false); } + + private String getToolTipText() { + if (mHoverView instanceof BubbleTextView btv) { + return btv.getText().toString(); + } else if (mHoverView instanceof FolderIcon icon && icon.mInfo.title != null) { + return icon.mInfo.title.toString(); + } else if (mHoverView instanceof AppPairIcon icon) { + return icon.getTitleTextView().getText().toString(); + } else { + return null; + } + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index b2989cd81a..a5cc124724 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -736,7 +736,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar if (taskIcon != null) { taskIcon = taskIcon.getConstantState().newDrawable().mutate(); } - btv.applyIconAndLabel(taskIcon, task.titleDescription); + btv.applyIconAndLabel(taskIcon, task.title, task.titleDescription); btv.setTag(singleTask); } diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt index d2b9fcf2c5..529174a253 100644 --- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.kt @@ -147,6 +147,15 @@ class TaskbarHoverToolTipControllerTest { assertThat(isHoverToolTipOpen).isFalse() } + @Test + fun onHover_emptyTitle_noTooltip() { + runOnMainSync { + iconView.text = "" + iconView.dispatchGenericMotionEvent(HOVER_ENTER) + } + assertThat(isHoverToolTipOpen).isFalse() + } + companion object { private val HOVER_EXIT = MotionEvent.obtain(0, 0, ACTION_HOVER_EXIT, 0f, 0f, 0) private val HOVER_ENTER = MotionEvent.obtain(0, 0, ACTION_HOVER_ENTER, 0f, 0f, 0) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 30e3a2b577..6684e4ce45 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -473,10 +473,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, * Directly set the icon and label. */ @UiThread - public void applyIconAndLabel(Drawable icon, CharSequence label) { + public void applyIconAndLabel(Drawable icon, CharSequence title, CharSequence description) { applyCompoundDrawables(icon); - setText(label); - setContentDescription(label); + setText(title); + setContentDescription(description); } /** Updates whether the app this view represents is currently running. */ From 8fc585ff6bc6ed826a8873bb1b2870f0cbb57226 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Wed, 19 Mar 2025 15:01:55 -0400 Subject: [PATCH 03/21] Perform system actions on focused display. Flag: EXEMPT bugfix Fix: 401575811 Test: go/testedequals Change-Id: I29743c98499d04f080f2628b7db7f123ec396585 --- .../com/android/launcher3/taskbar/TaskbarManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index 1521715ce0..bfe05df547 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -554,8 +554,7 @@ public class TaskbarManager { */ private void showTaskbarFromBroadcast(Intent intent) { debugPrimaryTaskbar("destroyTaskbarForDisplay"); - // TODO: make this code displayId specific - TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId()); + TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId()); if (ACTION_SHOW_TASKBAR.equals(intent.getAction()) && taskbar != null) { taskbar.showTaskbarFromBroadcast(); } @@ -575,7 +574,7 @@ public class TaskbarManager { * Toggles All Apps for Taskbar or Launcher depending on the current state. */ public void toggleAllAppsSearch() { - TaskbarActivityContext taskbar = getTaskbarForDisplay(getDefaultDisplayId()); + TaskbarActivityContext taskbar = getTaskbarForDisplay(getFocusedDisplayId()); if (taskbar == null) { // Home All Apps should be toggled from this class, because the controllers are not // initialized when Taskbar is disabled (i.e. TaskbarActivityContext is null). @@ -1670,6 +1669,10 @@ public class TaskbarManager { return mBaseContext.getDisplayId(); } + private int getFocusedDisplayId() { + return SystemUiProxy.INSTANCE.get(mBaseContext).getFocusState().getFocusedDisplayId(); + } + /** * Logs debug information about the TaskbarManager for primary display. * @param debugReason A string describing the reason for the debug log. From 4ec89fbc6354fadc851415cc4f935c0f6681bbf8 Mon Sep 17 00:00:00 2001 From: Shamali P Date: Fri, 21 Mar 2025 16:10:34 +0000 Subject: [PATCH 04/21] Add ViewStubs for DWB layouts to avoid duplicate views in refactor This CL just moves existing code to use view stubs. The refactor CLs will use the flag to conditionally inflate these views. Bug: 405359346 Fix: 405359346 Flag: EXEMPT refactor Test: Existing screenshot tests and manual demo Change-Id: Ib023d5f3538a0959a5965704a4ff18d769f8aa94 --- quickstep/res/layout/task.xml | 7 +++++-- quickstep/res/layout/task_grouped.xml | 14 ++++++++++---- .../com/android/quickstep/views/GroupedTaskView.kt | 3 +++ .../src/com/android/quickstep/views/TaskView.kt | 4 ++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/quickstep/res/layout/task.xml b/quickstep/res/layout/task.xml index def5a1e0a9..bac7b26c32 100644 --- a/quickstep/res/layout/task.xml +++ b/quickstep/res/layout/task.xml @@ -51,6 +51,9 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" /> - + \ No newline at end of file diff --git a/quickstep/res/layout/task_grouped.xml b/quickstep/res/layout/task_grouped.xml index a9a6dc1fc7..41f892f7fc 100644 --- a/quickstep/res/layout/task_grouped.xml +++ b/quickstep/res/layout/task_grouped.xml @@ -79,9 +79,15 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" /> - + - + \ No newline at end of file diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt index 3b8607b41c..f12dcbd2b1 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.kt @@ -113,6 +113,9 @@ class GroupedTaskView @JvmOverloads constructor(context: Context, attrs: Attribu else R.layout.icon_view } ?.inflate() + findViewById(R.id.bottomRight_digital_wellbeing_toast) + ?.apply { layoutResource = R.layout.digital_wellbeing_toast } + ?.inflate() } override fun onRecycle() { diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt index daecbfd4c4..e37e0f26df 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.kt +++ b/quickstep/src/com/android/quickstep/views/TaskView.kt @@ -784,6 +784,10 @@ constructor( else R.layout.icon_view } ?.inflate() + + findViewById(R.id.digital_wellbeing_toast) + ?.apply { layoutResource = R.layout.digital_wellbeing_toast } + ?.inflate() } override fun onAttachedToWindow() = From adb3bf5a8d9cdd96c240f2c6d741fd54822f47fe Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Mon, 24 Mar 2025 10:52:05 +0000 Subject: [PATCH 05/21] Notify StateManager of workspace reveal animations. This way any subsequent state changes during the animation will cancel it. Previously swiping up to All Apps immediately after going home would cause the 2 depth animations to interleave, ending with a depth of 0, for example. Now the workspace depth is cancelled and the All Apps depth is correctly applied. Demo: https://drive.google.com/file/d/1R1BwYAsxj31FDgAeIZqZdJbuSz7s9PZy/view?usp=sharing&resourcekey=0-4UyZfAMxecSHWAyqyeNZmg Fix: 405836159 Test: Manual (swipe home and immediately to all apps) Flag: EXEMPT bugfix Change-Id: Iac32f2a03a5cbbb297c71ebd9cfedc8ee6e8cae7 --- .../android/quickstep/util/ScalingWorkspaceRevealAnim.kt | 7 ++++++- .../com/android/quickstep/util/WorkspaceRevealAnim.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt index 63eae921b0..97d7ed1a63 100644 --- a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt +++ b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt @@ -25,6 +25,7 @@ import android.graphics.RectF import android.util.Log import android.view.View import android.view.animation.PathInterpolator +import androidx.core.animation.doOnStart import androidx.core.graphics.transform import com.android.app.animation.Animations import com.android.app.animation.Interpolators @@ -241,7 +242,11 @@ class ScalingWorkspaceRevealAnim( } fun getAnimators(): AnimatorSet { - return animation.buildAnim() + val animatorSet = animation.buildAnim() + animatorSet.doOnStart { + launcher.stateManager.setCurrentAnimation(animatorSet, LauncherState.NORMAL) + } + return animatorSet } fun start() { diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java index 32e0e132e0..e86adb81fb 100644 --- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java +++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java @@ -91,7 +91,9 @@ public class WorkspaceRevealAnim { PendingAnimation depthBuilder = new PendingAnimation(DURATION_MS); DepthController depth = ((QuickstepLauncher) launcher).getDepthController(); depth.setStateWithAnimation(NORMAL, new StateAnimationConfig(), depthBuilder); - mAnimators.play(depthBuilder.buildAnim()); + AnimatorSet animatorSet = depthBuilder.buildAnim(); + launcher.getStateManager().setCurrentAnimation(animatorSet, NORMAL); + mAnimators.play(animatorSet); } // Add sysui scrim animation. From 6daf7fd963aec066024c5c309fc3f6eceb0556d4 Mon Sep 17 00:00:00 2001 From: Schneider Victor-Tulias Date: Mon, 24 Mar 2025 11:13:15 -0400 Subject: [PATCH 06/21] Fix broken quick switch from home gesture with recents-in-window enabled Flag: com.android.launcher3.enable_launcher_overview_in_window Fixes: 405201109 Bug: 377678992 Test: used quick switch gesture from home with flag enabled. presubmit tests on temporary test cl Change-Id: I8dbd3a41c350aba6c785aa0b2c8f20da7a468998 --- quickstep/src/com/android/quickstep/InputConsumerUtils.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/InputConsumerUtils.kt b/quickstep/src/com/android/quickstep/InputConsumerUtils.kt index 89b5b291c6..af96a8b3b6 100644 --- a/quickstep/src/com/android/quickstep/InputConsumerUtils.kt +++ b/quickstep/src/com/android/quickstep/InputConsumerUtils.kt @@ -23,6 +23,7 @@ import com.android.launcher3.statemanager.BaseState import com.android.launcher3.statemanager.StatefulContainer import com.android.launcher3.taskbar.TaskbarManager import com.android.launcher3.util.LockedUserState.Companion.get +import com.android.quickstep.fallback.window.RecentsWindowFlags import com.android.quickstep.inputconsumers.AccessibilityInputConsumer import com.android.quickstep.inputconsumers.AssistantInputConsumer import com.android.quickstep.inputconsumers.BubbleBarInputConsumer @@ -631,6 +632,7 @@ object InputConsumerUtils { inputEventReceiver, gestureState, event, + runningTask.isHomeTask, ) } } @@ -790,13 +792,16 @@ object InputConsumerUtils { inputEventReceiver: InputChannelCompat.InputEventReceiver, gestureState: GestureState, event: MotionEvent, + isHomeTask: Boolean, ): InputConsumer where T : RecentsViewContainer, T : StatefulContainer { val shouldDefer = (!overviewComponentObserver.isHomeAndOverviewSame || gestureState .getContainerInterface() .deferStartingActivity(deviceState, event)) - val disableHorizontalSwipe = deviceState.isInExclusionRegion(event) + val disableHorizontalSwipe = + deviceState.isInExclusionRegion(event) && + (!RecentsWindowFlags.enableOverviewInWindow || !isHomeTask) return OtherActivityInputConsumer( /* base= */ context, deviceState, From 2044dae70e2472ee4efcf00d4dfe1b01917bbf1e Mon Sep 17 00:00:00 2001 From: Charlie Anderson Date: Tue, 18 Mar 2025 14:45:36 +0000 Subject: [PATCH 07/21] Fix folder closing to different shapes Bug: 403915526 Flag: com.android.launcher3.enable_launcher_icon_shapes Test: opening and closing apps from shaped folders Change-Id: I42f0f689151dcbbd5c8eb6bf424ec4ad7dbe435a --- .../android/launcher3/views/ClipIconView.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/com/android/launcher3/views/ClipIconView.java b/src/com/android/launcher3/views/ClipIconView.java index a295d6b52e..8439c3f98a 100644 --- a/src/com/android/launcher3/views/ClipIconView.java +++ b/src/com/android/launcher3/views/ClipIconView.java @@ -49,6 +49,7 @@ import com.android.launcher3.Flags; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.dragndrop.FolderAdaptiveIcon; +import com.android.launcher3.graphics.ShapeDelegate; import com.android.launcher3.graphics.ThemeManager; /** @@ -67,6 +68,7 @@ public class ClipIconView extends View implements ClipPathView { private @Nullable Drawable mBackground; private boolean mIsAdaptiveIcon = false; + private boolean mIsFolderIcon = false; private ValueAnimator mRevealAnimator; private float mIconScale; @@ -180,8 +182,9 @@ public class ClipIconView extends View implements ClipPathView { if ((!isOpening || Flags.enableLauncherIconShapes()) && progress >= shapeProgressStart) { if (mRevealAnimator == null) { - mRevealAnimator = themeManager.getIconShape() - .createRevealAnimator(this, mStartRevealRect, + ShapeDelegate shape = mIsFolderIcon ? themeManager.getFolderShape() + : themeManager.getIconShape(); + mRevealAnimator = shape.createRevealAnimator(this, mStartRevealRect, mOutline, mTaskCornerRadius, !isOpening); mRevealAnimator.addListener(forEndCallback(() -> mRevealAnimator = null)); mRevealAnimator.start(); @@ -235,7 +238,7 @@ public class ClipIconView extends View implements ClipPathView { boolean isOpening, DeviceProfile dp) { mIsAdaptiveIcon = drawable instanceof AdaptiveIconDrawable; if (mIsAdaptiveIcon) { - boolean isFolderIcon = drawable instanceof FolderAdaptiveIcon; + mIsFolderIcon = drawable instanceof FolderAdaptiveIcon; AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) drawable; Drawable background = adaptiveIcon.getBackground(); @@ -255,7 +258,7 @@ public class ClipIconView extends View implements ClipPathView { int blurMargin = mBlurSizeOutline / 2; mFinalDrawableBounds.set(0, 0, originalWidth, originalHeight); - if (!isFolderIcon) { + if (!mIsFolderIcon) { mFinalDrawableBounds.inset(iconOffset - blurMargin, iconOffset - blurMargin); } mForeground.setBounds(mFinalDrawableBounds); @@ -263,7 +266,7 @@ public class ClipIconView extends View implements ClipPathView { mStartRevealRect.set(0, 0, originalWidth, originalHeight); - if (!isFolderIcon) { + if (!mIsFolderIcon) { Utilities.scaleRectAboutCenter(mStartRevealRect, ICON_VISIBLE_AREA_FACTOR); } @@ -319,11 +322,13 @@ public class ClipIconView extends View implements ClipPathView { canvas.clipPath(mClipPath); } int count2 = canvas.save(); - float iconCenterX = - (mFinalDrawableBounds.right - mFinalDrawableBounds.left) / 2f * mIconScale; - float iconCenterY = - (mFinalDrawableBounds.bottom - mFinalDrawableBounds.top) / 2f * mIconScale; - canvas.scale(mIconScale, mIconScale, iconCenterX, iconCenterY); + if (!mIsFolderIcon) { + float iconCenterX = + (mFinalDrawableBounds.right - mFinalDrawableBounds.left) / 2f * mIconScale; + float iconCenterY = + (mFinalDrawableBounds.bottom - mFinalDrawableBounds.top) / 2f * mIconScale; + canvas.scale(mIconScale, mIconScale, iconCenterX, iconCenterY); + } if (mBackground != null) { mBackground.draw(canvas); } From 09a34530527cc178d49cf24683f70e769eff8247 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 24 Mar 2025 18:47:30 +0000 Subject: [PATCH 08/21] Still play home task dismiss animation when aniamtorSet is null - If onPrepareGestureEndAnimation is called with null aniamtorSet, plays the dismiss animator directly with 0 duration Fix: 405368787 Flag: EXEMPT bugfix Test: manual, adb shell input keyevent KEYCODE_APP_SWITCH or Window + Tab with keybnoard from home Change-Id: I16048f9454f79e2828c6a4a75b788b9838e886ab --- .../fallback/FallbackRecentsView.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index dc1cdde4bc..be9b4a1fc5 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -23,6 +23,7 @@ import static com.android.quickstep.fallback.RecentsState.DEFAULT; import static com.android.quickstep.fallback.RecentsState.MODAL_TASK; import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT; +import android.animation.Animator; import android.animation.AnimatorSet; import android.content.Context; import android.util.AttributeSet; @@ -136,17 +137,22 @@ public class FallbackRecentsView setCurrentTask(-1)); - AnimatorPlaybackController controller = pa.createPlaybackController(); + pendingAnimation.addEndListener(e -> setCurrentTask(-1)); + AnimatorPlaybackController controller = pendingAnimation.createPlaybackController(); controller.dispatchOnStart(); - animatorSet.play(controller.getAnimationPlayer()); + Animator homeDismissAnimator = controller.getAnimationPlayer(); + if (animatorSet != null) { + animatorSet.play(homeDismissAnimator); + } else { + homeDismissAnimator.setDuration(0).start(); + } } } } From 2f193110b76ad02d82f0abc13ef7bd220b780c90 Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Fri, 21 Mar 2025 17:58:54 +0000 Subject: [PATCH 09/21] Add debounce to TaskView emissions The emissions of each TaskView on Overview open are usually: 1. task exists 2. icon loaded 3. then thumbnail loaded If the 3 updates above come in quick succession, then ideally the first 2 will be debounced and the last one will be consumed immediately. Debouncing only when thumbnails are not present gives the best results. This is because thumbnail loading is a decent predictor of there being no more emissions to come as they are typically the last emission for a TaskView. Bug: 395294954 Flag: com.android.launcher3.enable_refactor_task_thumbnail Test: ABTD run of failing metric Change-Id: Ib57d6dc7d9f58b7bb37ec1177b23d89360c24c0e --- .../quickstep/recents/ui/viewmodel/TaskViewModel.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt b/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt index fac0c0a0bb..9f762e724c 100644 --- a/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt +++ b/quickstep/src/com/android/quickstep/recents/ui/viewmodel/TaskViewModel.kt @@ -34,6 +34,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOn @@ -91,6 +92,16 @@ class TaskViewModel( val state: Flow = combine(taskData, isLiveTile, overlayEnabled, isCentralTask, ::mapToTaskTile) .distinctUntilChanged() + .debounce { state -> + // Debouncing only when thumbnails are not present gives the best results. + // This is because thumbnail loading is a decent predictor of there being no more + // emissions to come as they are typically the last emission for a TaskView. + if (state.tasks.any { (it as? TaskData.Data)?.thumbnailData?.thumbnail == null }) { + DEBOUNCE_DELAY_MS + } else { + 0 + } + } .flowOn(dispatcherProvider.background) fun bind(vararg taskId: TaskId) { @@ -150,5 +161,6 @@ class TaskViewModel( private companion object { const val TAG = "TaskViewModel" + const val DEBOUNCE_DELAY_MS = 16L } } From 07c09556f0e69e3f626632be644e89f985849e7d Mon Sep 17 00:00:00 2001 From: Daniel Andersson Date: Fri, 14 Mar 2025 11:41:43 -0700 Subject: [PATCH 10/21] desktop-exploded-view: Avoid triggering layout when starting animation This fixes an issue with the desktop task view unexpectedly jumping first to the right, and then back to the left. See the bug for more information. Flag: com.android.launcher3.enable_desktop_exploded_view Test: Manual Bug=399822967 Change-Id: I3713b20effa2a7f25ca04ed83ed524772d23ca2f --- .../quickstep/views/DesktopTaskView.kt | 103 ++++++++---------- 1 file changed, 48 insertions(+), 55 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt index 8b124555f1..273fc77e70 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.kt @@ -179,7 +179,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu ?.inflate() } - private fun positionTaskWindows() { + private fun positionTaskWindows(updateLayout: Boolean = false) { if (taskContainers.isEmpty()) { return } @@ -197,33 +197,33 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu val scaleWidth = taskViewWidth / screenWidth.toFloat() val scaleHeight = taskViewHeight / screenHeight.toFloat() - taskContainers.forEach { - val taskId = it.task.key.id - val fullscreenTaskPosition = - fullscreenTaskPositions.firstOrNull { it.taskId == taskId } ?: return - val overviewTaskPosition = + taskContainers.forEach { taskContainer -> + val taskId = taskContainer.task.key.id + val fullscreenTaskBounds = + fullscreenTaskPositions.firstOrNull { it.taskId == taskId }?.bounds ?: return + val overviewTaskBounds = if (enableDesktopExplodedView()) { viewModel!! .organizedDesktopTaskPositions .firstOrNull { it.taskId == taskId } - ?.let { organizedPosition -> - TEMP_OVERVIEW_TASK_POSITION.apply { - lerpRect( - fullscreenTaskPosition.bounds, - organizedPosition.bounds, - explodeProgress, - ) - } - } ?: fullscreenTaskPosition.bounds + ?.bounds ?: fullscreenTaskBounds } else { - fullscreenTaskPosition.bounds + fullscreenTaskBounds + } + val currentTaskBounds = + if (enableDesktopExplodedView()) { + TEMP_OVERVIEW_TASK_POSITION.apply { + lerpRect(fullscreenTaskBounds, overviewTaskBounds, explodeProgress) + } + } else { + fullscreenTaskBounds } if (enableDesktopExplodedView()) { getRemoteTargetHandle(taskId)?.let { remoteTargetHandle -> val fromRect = TEMP_FROM_RECTF.apply { - set(fullscreenTaskPosition.bounds) + set(fullscreenTaskBounds) scale(scaleWidth) offset( lastComputedTaskSize.left.toFloat(), @@ -232,7 +232,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu } val toRect = TEMP_TO_RECTF.apply { - set(overviewTaskPosition) + set(currentTaskBounds) scale(scaleWidth) offset( lastComputedTaskSize.left.toFloat(), @@ -246,41 +246,30 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu } } - val taskLeft = overviewTaskPosition.left * scaleWidth - val taskTop = overviewTaskPosition.top * scaleHeight - val taskWidth = overviewTaskPosition.width() * scaleWidth - val taskHeight = overviewTaskPosition.height() * scaleHeight - // TODO(b/394660950): Revisit the choice to update the layout when explodeProgress == 1. - // To run the explode animation in reverse, it may be simpler to use translation/scale - // for all cases where the progress is non-zero. - if (explodeProgress == 0.0f || explodeProgress == 1.0f) { - // Reset scaling and translation that may have been applied during animation. - it.snapshotView.apply { - scaleX = 1.0f - scaleY = 1.0f - translationX = 0.0f - translationY = 0.0f - } - + val overviewTaskLeft = overviewTaskBounds.left * scaleWidth + val overviewTaskTop = overviewTaskBounds.top * scaleHeight + val overviewTaskWidth = overviewTaskBounds.width() * scaleWidth + val overviewTaskHeight = overviewTaskBounds.height() * scaleHeight + if (updateLayout) { // Position the task to the same position as it would be on the desktop - it.snapshotView.updateLayoutParams { + taskContainer.snapshotView.updateLayoutParams { gravity = Gravity.LEFT or Gravity.TOP - width = taskWidth.toInt() - height = taskHeight.toInt() - leftMargin = taskLeft.toInt() - topMargin = taskTop.toInt() + width = overviewTaskWidth.toInt() + height = overviewTaskHeight.toInt() + leftMargin = overviewTaskLeft.toInt() + topMargin = overviewTaskTop.toInt() } if ( enableDesktopRecentsTransitionsCornersBugfix() && enableRefactorTaskThumbnail() ) { - it.thumbnailView.outlineBounds = - if (intersects(overviewTaskPosition, screenRect)) - Rect(overviewTaskPosition).apply { + taskContainer.thumbnailView.outlineBounds = + if (intersects(overviewTaskBounds, screenRect)) + Rect(overviewTaskBounds).apply { intersectUnchecked(screenRect) // Offset to 0,0 to transform into TaskThumbnailView's coordinate // system. - offset(-overviewTaskPosition.left, -overviewTaskPosition.top) + offset(-overviewTaskBounds.left, -overviewTaskBounds.top) left = (left * scaleWidth).roundToInt() top = (top * scaleHeight).roundToInt() right = (right * scaleWidth).roundToInt() @@ -288,17 +277,21 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu } else null } - } else { - // During the animation, apply translation and scale such that the view is - // transformed to where we want, without triggering layout. - it.snapshotView.apply { - pivotX = 0.0f - pivotY = 0.0f - translationX = taskLeft - left - translationY = taskTop - top - scaleX = taskWidth / width.toFloat() - scaleY = taskHeight / height.toFloat() - } + } + + val currentTaskLeft = currentTaskBounds.left * scaleWidth + val currentTaskTop = currentTaskBounds.top * scaleHeight + val currentTaskWidth = currentTaskBounds.width() * scaleWidth + val currentTaskHeight = currentTaskBounds.height() * scaleHeight + // During the animation, apply translation and scale such that the view is transformed + // to where we want, without triggering layout. + taskContainer.snapshotView.apply { + pivotX = 0.0f + pivotY = 0.0f + translationX = currentTaskLeft - overviewTaskLeft + translationY = currentTaskTop - overviewTaskTop + scaleX = currentTaskWidth / overviewTaskWidth + scaleY = currentTaskHeight / overviewTaskHeight } } } @@ -509,7 +502,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu if (enableDesktopExplodedView()) { viewModel?.organizeDesktopTasks(desktopSize, fullscreenTaskPositions) } - positionTaskWindows() + positionTaskWindows(updateLayout = true) } companion object { From 8161b7c9efb6ef83edb1a746096bb6f440b13a63 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Mon, 24 Mar 2025 23:04:57 +0000 Subject: [PATCH 11/21] Update personalWork tabs and work related fonts Bug:393609630 Test - manually: AA tab work enabled flag off: https://hsv.googleplex.com/5718615755063296 AA tab work enabled flag on: https://hsv.googleplex.com/6373838181892096 AA tab work disabled flag off: https://hsv.googleplex.com/5020660391739392 AA tab work disabled flag on: https://hsv.googleplex.com/5242306297856000 Flag: com.android.launcher3.gsf_res Change-Id: Ic1069bc636429f63ab6d583940c14fa7f0211f61 --- res/layout/all_apps_personal_work_tabs.xml | 4 ++-- res/layout/work_apps_paused.xml | 6 ++++-- res/layout/work_mode_fab.xml | 2 +- res/values/styles.xml | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/res/layout/all_apps_personal_work_tabs.xml b/res/layout/all_apps_personal_work_tabs.xml index 1435f8203d..f81ea977e7 100644 --- a/res/layout/all_apps_personal_work_tabs.xml +++ b/res/layout/all_apps_personal_work_tabs.xml @@ -37,7 +37,7 @@ android:contentDescription="@string/all_apps_personal_tab_content_description" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" - style="?android:attr/borderlessButtonStyle" /> + style="@style/AllAppsPersonalWorkTabStyle" />