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

Commit c335ad28 authored by Thales Lima's avatar Thales Lima
Browse files

launcher: use a different task menu for foldables

Foldables use a different menu from phones, positioned either to the
right or left of the app icon, and display an arrow. Since TaskMenuView
is very specific for handhelds, it was cleaner to create another class
to handle foldables case extending from ArrowPopup.

This creates a working menu, the correct style will come in later CLs.

Bug: 193432925
Test: open Overview and tap the app icon

Fixes: 205298731
Test: atest NexusLauncherTests

Change-Id: I7a5c1fb4800a309f40fadb2df0f6c3a4c3f42679
parent 2e2f49e8
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -278,16 +278,15 @@ android_library {
    srcs: [
        ":launcher-src-no-build-config",
    ],
    resource_dirs: [
        "quickstep/res",
    ],
    resource_dirs: [],
    libs: [
        "framework-statsd",
    ],
    static_libs: [
        "QuickstepResLib",
        "SystemUI-statsd",
        "SystemUISharedLib",
        "Launcher3CommonDepsLib"
        "Launcher3CommonDepsLib",
    ],
    manifest: "quickstep/AndroidManifest.xml",
    platform_apis: true,
+4 −3
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@
     limitations under the License.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="?android:attr/colorPrimary"/>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <solid android:color="?androidprv:attr/colorSurface" />
    <corners android:radius="@dimen/task_menu_item_corner_radius" />
</shape>
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2021 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.
-->
<com.android.quickstep.views.TaskMenuViewWithArrow
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:animateLayoutChanges="true"
    android:background="@drawable/task_menu_bg"
    android:orientation="vertical"
    android:visibility="invisible">

    <LinearLayout
        android:id="@+id/menu_option_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:showDividers="middle" />

</com.android.quickstep.views.TaskMenuViewWithArrow>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:orientation="horizontal"
    android:paddingTop="@dimen/task_card_menu_option_vertical_padding"
    android:paddingBottom="@dimen/task_card_menu_option_vertical_padding"
    android:background="@drawable/task_menu_item_bg"
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
    <dimen name="task_menu_corner_radius">22dp</dimen>
    <dimen name="task_menu_item_corner_radius">4dp</dimen>
    <dimen name="task_menu_spacing">2dp</dimen>
    <dimen name="task_menu_width_grid">200dp</dimen>
    <dimen name="task_menu_width_grid">234dp</dimen>
    <dimen name="overview_proactive_row_height">48dp</dimen>
    <dimen name="overview_proactive_row_bottom_margin">16dp</dimen>

@@ -91,7 +91,7 @@
    <dimen name="task_menu_vertical_padding">8dp</dimen>
    <dimen name="task_card_margin">8dp</dimen>
    <dimen name="task_card_menu_shadow_height">3dp</dimen>
    <dimen name="task_menu_option_start_margin">12dp</dimen>
    <dimen name="task_menu_option_start_margin">16dp</dimen>
    <!-- Copied from framework resource:
       docked_stack_divider_thickness - 2 * docked_stack_divider_insets -->
    <dimen name="multi_window_task_divider_size">10dp</dimen>
Loading