Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7645ef2e authored by Jon Miranda's avatar Jon Miranda
Browse files

Simple implementation of Taskbar Overflow.

- Adds placeholder view to represent the Overflow affordance.
- Overflow button will always appear as long as there are any
  recent apps.*
- Click / long click on the button will open KeyboardQuickSwitch
- Relevant code is Guarded by Flags.taskbarOverflow.

*Note that this is not up to spec. This change is only meant to
setup the codebase to support Taskbar Overflow.

Bug: 368119679
Test: open app, enter desktop windowing, click overflow button
Flag: com.android.launcher3.taskbar_overflow
Change-Id: I47f96797408fda09e8326ba8fb7981c91de80e36
parent 0e795f08
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2024 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportHeight="960"
    android:viewportWidth="960">
    <path
        android:fillColor="@color/taskbar_divider_background"
        android:pathData="M80,605v-250q0,-28.88 20.59,-49.44t49.5,-20.56q28.91,0 49.41,20.56Q220,326.12 220,355v250q0,28.87 -20.59,49.44Q178.82,675 149.91,675t-49.41,-20.56Q80,633.87 80,605ZM340,760q-24,0 -42,-18t-18,-42v-440q0,-24 18,-42t42,-18h280q24,0 42,18t18,42v440q0,24 -18,42t-42,18L340,760ZM740,605v-250q0,-28.88 20.59,-49.44t49.5,-20.56q28.91,0 49.41,20.56Q880,326.12 880,355v250q0,28.87 -20.59,49.44Q838.82,675 809.91,675t-49.41,-20.56Q740,633.87 740,605ZM340,700h280v-440L340,260v440ZM480,480Z"/>
</vector>
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2024 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- Note: The actual size will match the taskbar icon sizes in TaskbarView#onLayout(). -->
<com.android.launcher3.views.IconButtonView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/BaseIcon.Workspace.Taskbar"
    android:layout_width="@dimen/taskbar_icon_min_touch_size"
    android:layout_height="@dimen/taskbar_icon_min_touch_size"
    android:backgroundTint="@android:color/transparent"
    android:contentDescription="@string/taskbar_overflow_a11y_title" />
+2 −0
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@
    <string name="change_navigation_mode">Change navigation mode</string>
    <!-- Accessibility title for the Taskbar vertical divider icon. [CHAR_LIMIT=NONE] -->
    <string name="taskbar_divider_a11y_title">Taskbar Divider</string>
    <!-- Accessibility title for the Taskbar Overflow icon. [CHAR_LIMIT=NONE] -->
    <string name="taskbar_overflow_a11y_title">Taskbar Overflow</string>


    <!-- Label for moving drop target to the top or left side of the screen, depending on orientation (from the Taskbar only). -->
+6 −2
Original line number Diff line number Diff line
@@ -58,8 +58,12 @@ import java.util.List;
import java.util.Locale;

/**
 * View that allows quick switching between recent tasks through keyboard alt-tab and alt-shift-tab
 * commands.
 * View that allows quick switching between recent tasks.
 *
 * Can be access via:
 * - keyboard alt-tab
 * - alt-shift-tab
 * - taskbar overflow button
 */
public class KeyboardQuickSwitchView extends ConstraintLayout {

+6 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_ON_BOARD_POPUP;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY;
import static com.android.launcher3.Flags.enableCursorHoverStates;
import static com.android.launcher3.Flags.taskbarOverflow;
import static com.android.launcher3.Utilities.calculateTextHeight;
import static com.android.launcher3.Utilities.isRunningInTestHarness;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
@@ -1221,6 +1222,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        RecentsView recents = taskbarUIController.getRecentsView();
        boolean shouldCloseAllOpenViews = true;
        Object tag = view.getTag();

        if (taskbarOverflow()) {
            mControllers.keyboardQuickSwitchController.closeQuickSwitchView(false);
        }

        if (tag instanceof GroupTask groupTask) {
            handleGroupTaskLaunch(
                    groupTask,
Loading