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

Commit 146453c0 authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Add change split screen focus shortcut to the shortcut instructions menu" into main

parents 43526e4c 5c627d24
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2013,6 +2013,10 @@
    <string name="system_multitasking_lhs">Enter split screen with current app to LHS</string>
    <!-- User visible title for the keyboard shortcut that switches from split screen to full screen [CHAR LIMIT=70] -->
    <string name="system_multitasking_full_screen">Switch from split screen to full screen</string>
    <!-- User visible title for the keyboard shortcut that switches to app on right or below while using split screen [CHAR LIMIT=70] -->
    <string name="system_multitasking_splitscreen_focus_rhs">Switch to app on right or below while using split screen</string>
    <!-- User visible title for the keyboard shortcut that switches to app on left or above while using split screen [CHAR LIMIT=70] -->
    <string name="system_multitasking_splitscreen_focus_lhs">Switch to app on left or above while using split screen</string>
    <!-- User visible title for the keyboard shortcut that replaces an app from one to another during split screen [CHAR LIMIT=70] -->
    <string name="system_multitasking_replace">During split screen: replace an app from one to another</string>

+32 −25
Original line number Diff line number Diff line
@@ -631,32 +631,39 @@ public final class KeyboardShortcutListSearch {
        //    Enter Split screen with current app to RHS: Meta + Ctrl + Right arrow
        //    Enter Split screen with current app to LHS: Meta + Ctrl + Left arrow
        //    Switch from Split screen to full screen: Meta + Ctrl + Up arrow
        String[] shortcutLabels = {
                context.getString(R.string.system_multitasking_rhs),
                context.getString(R.string.system_multitasking_lhs),
                context.getString(R.string.system_multitasking_full_screen),
        };
        int[] keyCodes = {
        //    Change split screen focus to RHS: Meta + Alt + Right arrow
        //    Change split screen focus to LHS: Meta + Alt + Left arrow
        systemMultitaskingGroup.addItem(
                getMultitaskingShortcut(context.getString(R.string.system_multitasking_rhs),
                        KeyEvent.KEYCODE_DPAD_RIGHT,
                        KeyEvent.META_META_ON | KeyEvent.META_CTRL_ON));
        systemMultitaskingGroup.addItem(
                getMultitaskingShortcut(context.getString(R.string.system_multitasking_lhs),
                        KeyEvent.KEYCODE_DPAD_LEFT,
                        KeyEvent.META_META_ON | KeyEvent.META_CTRL_ON));
        systemMultitaskingGroup.addItem(
                getMultitaskingShortcut(context.getString(R.string.system_multitasking_full_screen),
                        KeyEvent.KEYCODE_DPAD_UP,
        };
                        KeyEvent.META_META_ON | KeyEvent.META_CTRL_ON));
        systemMultitaskingGroup.addItem(
                getMultitaskingShortcut(
                        context.getString(R.string.system_multitasking_splitscreen_focus_rhs),
                        KeyEvent.KEYCODE_DPAD_RIGHT,
                        KeyEvent.META_META_ON | KeyEvent.META_ALT_ON));
        systemMultitaskingGroup.addItem(
                getMultitaskingShortcut(
                        context.getString(R.string.system_multitasking_splitscreen_focus_lhs),
                        KeyEvent.KEYCODE_DPAD_LEFT,
                        KeyEvent.META_META_ON | KeyEvent.META_ALT_ON));
        return systemMultitaskingGroup;
    }

        for (int i = 0; i < shortcutLabels.length; i++) {
            List<ShortcutKeyGroup> shortcutKeyGroups = Arrays.asList(new ShortcutKeyGroup(
                    new KeyboardShortcutInfo(
                            shortcutLabels[i],
                            keyCodes[i],
                            KeyEvent.META_META_ON | KeyEvent.META_CTRL_ON),
    private static ShortcutMultiMappingInfo getMultitaskingShortcut(String shortcutLabel,
            int keycode, int modifiers) {
        List<ShortcutKeyGroup> shortcutKeyGroups = Arrays.asList(
                new ShortcutKeyGroup(new KeyboardShortcutInfo(shortcutLabel, keycode, modifiers),
                        null));
            ShortcutMultiMappingInfo shortcutMultiMappingInfo =
                    new ShortcutMultiMappingInfo(
                            shortcutLabels[i],
                            null,
                            shortcutKeyGroups);
            systemMultitaskingGroup.addItem(shortcutMultiMappingInfo);
        }
        return systemMultitaskingGroup;
        return new ShortcutMultiMappingInfo(shortcutLabel, null, shortcutKeyGroups);
    }

    private static KeyboardShortcutMultiMappingGroup getMultiMappingInputShortcuts(