From ff6bc2ab5fe5cba70f669cdf487c6c96330e7369 Mon Sep 17 00:00:00 2001 From: Becky Qiu Date: Mon, 15 Jun 2020 15:25:10 -0700 Subject: [PATCH] [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 --- .../android/quickstep/TaskOverlayFactory.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java index 177f9a0b68..0101ac75d9 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java @@ -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. */