Hide scroll arrows from Alt+Tab UI

Recent recommendation from UX was to hide scroll arrows from
Alt+Tab UI, as the primary use case is keyboard focused.

Bug: 397975686
Flag: com.android.launcher3.taskbar_overflow
Test: Verify that arrows are visible when KQS is opened from taskbar
      overflow button (when there's enough items to make KQS
      scrollable), and invisible when triggered using Alt+Tab shortcut.
Change-Id: Iaab234aca94d262b8151a680a08d10d6b39054ed
This commit is contained in:
Toni Barzic
2025-03-18 19:41:59 +00:00
parent fedb2319af
commit c2cb80434f
2 changed files with 18 additions and 13 deletions
@@ -47,7 +47,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.android.app.animation.Interpolators;
import com.android.internal.jank.Cuj;
import com.android.launcher3.Flags;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat;
@@ -180,17 +179,6 @@ public class KeyboardQuickSwitchView extends ConstraintLayout {
mIsRtl = Utilities.isRtl(resources);
if (Flags.taskbarOverflow()) {
initializeScrollArrows();
if (mIsRtl) {
mStartScrollArrow.setContentDescription(
resources.getString(R.string.quick_switch_scroll_arrow_right));
mEndScrollArrow.setContentDescription(
resources.getString(R.string.quick_switch_scroll_arrow_left));
}
}
TypefaceUtils.setTypeface(
mNoRecentItemsPane.findViewById(R.id.no_recent_items_text),
FontFamily.GSF_LABEL_LARGE);
@@ -359,9 +347,21 @@ public class KeyboardQuickSwitchView extends ConstraintLayout {
});
}
private void initializeScrollArrows() {
void enableScrollArrowSupport() {
if (mSupportsScrollArrows) {
return;
}
mSupportsScrollArrows = true;
if (mIsRtl) {
mStartScrollArrow.setContentDescription(
getResources().getString(R.string.quick_switch_scroll_arrow_right));
mEndScrollArrow.setContentDescription(
getResources().getString(R.string.quick_switch_scroll_arrow_left));
}
mStartScrollArrow.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
@@ -34,6 +34,7 @@ import androidx.annotation.Nullable;
import com.android.internal.jank.Cuj;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
@@ -119,6 +120,10 @@ public class KeyboardQuickSwitchViewController {
mWasDesktopTaskFilteredOut = wasDesktopTaskFilteredOut;
mWasOpenedFromTaskbar = wasOpenedFromTaskbar;
if (Flags.taskbarOverflow() && wasOpenedFromTaskbar) {
mKeyboardQuickSwitchView.enableScrollArrowSupport();
}
mKeyboardQuickSwitchView.applyLoadPlan(
mOverlayContext,
tasks,