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

Commit ff6bc2ab authored by Becky Qiu's avatar Becky Qiu
Browse files

[Overview Actions] For in-place landscape, add select only when aiai works.

When display orientation is not the same as device orientation, aiai won't work for select mode highlight. So we should only show the select button in task menu for in-place landscape when the display rotation is the same as the device rotation which is portrait.

Screenshot would be in the task menu for in-place landscape all the time.

Test: demo video: https://drive.google.com/file/d/1OQrjww2lFTTsthz4dB3BSa-jw943KLWp/view?usp=sharing
Change-Id: I58b6f6da234ea36eef0af5bb966c33ebda3625b8
parent 4de12a24
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -70,10 +70,19 @@ public class TaskOverlayFactory implements ResourceBasedOverride {

        // Add overview actions to the menu when in in-place rotate landscape mode.
        if (!canLauncherRotate && isInLandscape) {
            for (TaskShortcutFactory actionMenuOption : ACTION_MENU_OPTIONS) {
                SystemShortcut shortcut = actionMenuOption.getShortcut(activity, taskView);
                if (shortcut != null) {
                    shortcuts.add(shortcut);
            // Add screenshot action to task menu.
            SystemShortcut screenshotShortcut = TaskShortcutFactory.SCREENSHOT
                    .getShortcut(activity, taskView);
            if (screenshotShortcut != null) {
                shortcuts.add(screenshotShortcut);
            }

            // Add modal action only if display orientation is the same as the device orientation.
            if (orientedState.getDisplayRotation() == ROTATION_0) {
                SystemShortcut modalShortcut = TaskShortcutFactory.MODAL
                        .getShortcut(activity, taskView);
                if (modalShortcut != null) {
                    shortcuts.add(modalShortcut);
                }
            }
        }
@@ -104,11 +113,6 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
            TaskShortcutFactory.WELLBEING
    };

    private static final TaskShortcutFactory[] ACTION_MENU_OPTIONS = new TaskShortcutFactory[]{
        TaskShortcutFactory.SCREENSHOT,
        TaskShortcutFactory.MODAL
    };

    /**
     * Overlay on each task handling Overview Action Buttons.
     */