From cc0b8602354b237773a3fe24b19d804c55553f8f Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Wed, 15 Feb 2023 15:32:16 -0800 Subject: [PATCH] Show highlight around the selected overview tile Enable highlight around focused overview item when desktop windowing prototypes are enabled. This highlight was built for and enabled with keyboard quickswitch feature. We don't support quickswitch on desktop yet. Disable the quickswitch, but keep the border highlight. Bug: 269342116 Test: enable desktop windowing proto, use an external keyboard and alt+tab to switch between apps, observe highlight in overview, no quickswitch popup Test: enable desktop windowing proto, enable ENABLE_KEYBOARD_QUICK_SWITCH, observe that alt+tab still opens overview Test: disable desktop windowing proto, enable ENABLE_KEYBOARD_QUICK_SWITCH, observe alt+tab opens the quickswitch popup, and highlights in overview Change-Id: I15b36f082610f4ce38143856c84fef723f1b8ba0 --- .../src/com/android/quickstep/OverviewCommandHelper.java | 6 ++++++ quickstep/src/com/android/quickstep/views/TaskView.java | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index d0fd65f817..ac5b2f2ff7 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -37,6 +37,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.taskbar.TaskbarUIController; import com.android.launcher3.util.RunnableList; import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; +import com.android.quickstep.views.DesktopTaskView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; @@ -185,6 +186,11 @@ public class OverviewCommandHelper { && dp != null && (dp.isTablet || dp.isTwoPanels); + if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { + // TODO(b/268075592): add support for quickswitch to/from desktop + allowQuickSwitch = false; + } + if (cmd.type == TYPE_HIDE) { if (!allowQuickSwitch) { return true; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 0e2f020cb1..df67b99034 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -431,9 +431,12 @@ public class TaskView extends FrameLayout implements Reusable { mCurrentFullscreenParams = new FullscreenDrawParams(context); mDigitalWellBeingToast = new DigitalWellBeingToast(mActivity, this); - setWillNotDraw(!FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get()); + boolean keyboardFocusHighlightEnabled = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get() + || DesktopTaskView.DESKTOP_MODE_SUPPORTED; - mBorderAnimator = !FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get() + setWillNotDraw(!keyboardFocusHighlightEnabled); + + mBorderAnimator = !keyboardFocusHighlightEnabled ? null : new BorderAnimator( /* borderBoundsBuilder= */ this::updateBorderBounds,