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

Commit 52caf634 authored by Charlie Anderson's avatar Charlie Anderson
Browse files

Fixes several Visual issues with the app shortcut popup

- Fix system shortcut alignment and ordering.
- Replace horizontal split icon with correct size drawable.
- Remove popup shortcut reversing logic, and instead show same order of shortcuts regardless of orientation.

Test: tested manually on tablet and phone
Bug:269343928
Change-Id: I1700ad1ee04abf0820c87d89e1dc07d6880fd519
parent 83683829
Loading
Loading
Loading
Loading
+28 −15
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ import static com.android.launcher3.config.FeatureFlags.RECEIVE_UNFOLD_EVENTS_FR
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.SystemShortcut.APP_INFO;
import static com.android.launcher3.popup.SystemShortcut.INSTALL;
import static com.android.launcher3.popup.SystemShortcut.WIDGETS;
import static com.android.launcher3.taskbar.LauncherTaskbarUIController.ALL_APPS_PAGE_PROGRESS_INDEX;
import static com.android.launcher3.taskbar.LauncherTaskbarUIController.MINUS_ONE_PAGE_PROGRESS_INDEX;
import static com.android.launcher3.taskbar.LauncherTaskbarUIController.WIDGETS_PAGE_PROGRESS_INDEX;
@@ -186,6 +189,8 @@ import com.android.systemui.unfold.updates.RotationChangeProvider;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
@@ -385,8 +390,20 @@ public class QuickstepLauncher extends Launcher {

    @Override
    public Stream<SystemShortcut.Factory> getSupportedShortcuts() {
        Stream<SystemShortcut.Factory> base = Stream.of(WellbeingModel.SHORTCUT_FACTORY);
        if (ENABLE_SPLIT_FROM_WORKSPACE.get() && mDeviceProfile.isTablet) {
        // Order matters as it affects order of appearance in popup container
        List<SystemShortcut.Factory> shortcuts = new ArrayList(Arrays.asList(
                APP_INFO, WellbeingModel.SHORTCUT_FACTORY, mHotseatPredictionController));
        shortcuts.addAll(getSplitShortcuts());
        shortcuts.add(WIDGETS);
        shortcuts.add(INSTALL);
        return shortcuts.stream();
    }

    private List<SystemShortcut.Factory<QuickstepLauncher>> getSplitShortcuts() {

        if (!ENABLE_SPLIT_FROM_WORKSPACE.get() || !mDeviceProfile.isTablet) {
            return Collections.emptyList();
        }
        RecentsView recentsView = getOverviewPanel();
        // TODO(b/266482558): Pull it out of PagedOrentationHandler for split from workspace.
        List<SplitPositionOption> positions =
@@ -396,11 +413,7 @@ public class QuickstepLauncher extends Launcher {
        for (SplitPositionOption position : positions) {
            splitShortcuts.add(getSplitSelectShortcutByPosition(position));
        }
            base = Stream.concat(base, splitShortcuts.stream());
        }
        return Stream.concat(
                Stream.of(mHotseatPredictionController),
                Stream.concat(base, super.getSupportedShortcuts()));
        return splitShortcuts;
    }

    /**
+5 −5
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="16dp"
    android:viewportWidth="20"
    android:viewportHeight="16">
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
  <path
      android:pathData="M18,14L13,14L13,2L18,2L18,14ZM20,14L20,2C20,0.9 19.1,-0 18,-0L13,-0C11.9,-0 11,0.9 11,2L11,14C11,15.1 11.9,16 13,16L18,16C19.1,16 20,15.1 20,14ZM7,14L2,14L2,2L7,2L7,14ZM9,14L9,2C9,0.9 8.1,-0 7,-0L2,-0C0.9,-0 -0,0.9 -0,2L-0,14C-0,15.1 0.9,16 2,16L7,16C8.1,16 9,15.1 9,14Z"
      android:pathData="M4,6L9,6L9,18L4,18L4,6ZM2,6L2,18C2,19.1 2.9,20 4,20L9,20C10.1,20 11,19.1 11,18L11,6C11,4.9 10.1,4 9,4L4,4C2.9,4 2,4.9 2,6ZM15,6L20,6L20,18L15,18L15,6ZM13,6L13,18C13,19.1 13.9,20 15,20L20,20C21.1,20 22,19.1 22,18L22,6C22,4.9 21.1,4 20,4L15,4C13.9,4 13,4.9 13,6Z"
      android:fillColor="#000000"/>
</vector>
+1 −8
Original line number Diff line number Diff line
@@ -22,11 +22,4 @@
    android:orientation="horizontal"
    android:gravity="end|center_vertical"
    android:background="@drawable/single_item_primary"
    android:elevation="@dimen/deep_shortcuts_elevation"
    android:clipToPadding="true">

    <Space android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:id="@+id/separator"/>
</LinearLayout>
    android:elevation="@dimen/deep_shortcuts_elevation"/>
+1 −7
Original line number Diff line number Diff line
@@ -23,10 +23,4 @@
    android:orientation="horizontal"
    android:gravity="end|center_vertical"
    android:background="@drawable/popup_background_material_u"
    android:elevation="@dimen/deep_shortcuts_elevation">

    <Space android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:id="@+id/separator"/>
</LinearLayout>
    android:elevation="@dimen/deep_shortcuts_elevation"/>
Loading