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

Commit 56a22c09 authored by Ben Murdoch's avatar Ben Murdoch Committed by Android (Google) Code Review
Browse files

Merge "Keyboard shortcut helper A11y improvements." into main

parents 8645154c 525892e5
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1837,8 +1837,8 @@
    <!-- User visible string that joins different shortcuts in a list, e.g. shortcut1 "or" shortcut2 "or" ... -->
    <string  name="keyboard_shortcut_join">or</string>

    <!-- Content description for the clear text button in shortcut search list. [CHAR LIMIT=NONE] -->
    <string name="keyboard_shortcut_clear_text">Clear text</string>
    <!-- Content description for the clear search button in shortcut search list. [CHAR LIMIT=NONE] -->
    <string name="keyboard_shortcut_clear_text">Clear search query</string>
    <!-- The title for keyboard shortcut search list [CHAR LIMIT=25] -->
    <string name="keyboard_shortcut_search_list_title">Shortcuts</string>
    <!-- The hint for keyboard shortcut search list [CHAR LIMIT=25] -->
@@ -1854,6 +1854,17 @@
    <!-- The title of current app category in shortcut search list. [CHAR LIMIT=25] -->
    <string name="keyboard_shortcut_search_category_current_app">Current app</string>

    <!-- A11y message when showing keyboard shortcut search results. [CHAR LIMT=NONE] -->
    <string name="keyboard_shortcut_a11y_show_search_results">Showing search results</string>
    <!-- A11y message when filtering to "system" keyboard shortcuts.  [CHAR LIMT=NONE] -->
    <string name="keyboard_shortcut_a11y_filter_system">Showing system shortcuts</string>
    <!-- A11y message when filtering to "input" keyboard shortcuts.  [CHAR LIMT=NONE] -->
    <string name="keyboard_shortcut_a11y_filter_input">Showing input shortcuts</string>
    <!-- A11y message when filtering to "app opening" keyboard shortcuts.  [CHAR LIMT=NONE] -->
    <string name="keyboard_shortcut_a11y_filter_open_apps">Showing shortcuts that open apps</string>
    <!-- A11y message when filtering to "current app" keyboard shortcuts.  [CHAR LIMT=NONE] -->
    <string name="keyboard_shortcut_a11y_filter_current_app">Showing shortcuts for the current app</string>

    <!-- User visible title for the keyboard shortcut that triggers the notification shade. [CHAR LIMIT=70] -->
    <string name="group_system_access_notification_shade">View notifications</string>
    <!-- User visible title for the keyboard shortcut that takes a full screenshot. [CHAR LIMIT=70] -->
+26 −13
Original line number Diff line number Diff line
@@ -811,11 +811,12 @@ public final class KeyboardShortcutListSearch {
                new BottomSheetDialog(mContext);
        final View keyboardShortcutsView = inflater.inflate(
                R.layout.keyboard_shortcuts_search_view, null);
        LinearLayout shortcutsContainer = keyboardShortcutsView.findViewById(
                R.id.keyboard_shortcuts_container);
        mNoSearchResults = keyboardShortcutsView.findViewById(R.id.shortcut_search_no_result);
        mKeyboardShortcutsBottomSheetDialog.setContentView(keyboardShortcutsView);
        setButtonsDefaultStatus(keyboardShortcutsView);
        populateKeyboardShortcutSearchList(
                keyboardShortcutsView.findViewById(R.id.keyboard_shortcuts_container));
        populateKeyboardShortcutSearchList(shortcutsContainer);

        // Workaround for solve issue about dialog not full expanded when landscape.
        FrameLayout bottomSheet = (FrameLayout)
@@ -865,9 +866,14 @@ public final class KeyboardShortcutListSearch {
                    @Override
                    public void afterTextChanged(Editable s) {
                        mQueryString = s.toString();
                        populateKeyboardShortcutSearchList(
                                keyboardShortcutsView.findViewById(
                                        R.id.keyboard_shortcuts_container));
                        populateKeyboardShortcutSearchList(shortcutsContainer);
                        if (mNoSearchResults.getVisibility() == View.VISIBLE) {
                            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                                    R.string.keyboard_shortcut_search_list_no_result));
                        } else if (mSearchEditText.getText().length() > 0) {
                            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                                    R.string.keyboard_shortcut_a11y_show_search_results));
                        }
                    }

                    @Override
@@ -1222,28 +1228,35 @@ public final class KeyboardShortcutListSearch {
        mButtonOpenApps = keyboardShortcutsView.findViewById(R.id.shortcut_open_apps);
        mButtonSpecificApp = keyboardShortcutsView.findViewById(R.id.shortcut_specific_app);

        LinearLayout shortcutsContainer = keyboardShortcutsView.findViewById(
                R.id.keyboard_shortcuts_container);

        mButtonSystem.setOnClickListener(v -> {
            setCurrentCategoryIndex(SHORTCUT_SYSTEM_INDEX);
            populateKeyboardShortcutSearchList(keyboardShortcutsView.findViewById(
                    R.id.keyboard_shortcuts_container));
            populateKeyboardShortcutSearchList(shortcutsContainer);
            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                    R.string.keyboard_shortcut_a11y_filter_system));
        });

        mButtonInput.setOnClickListener(v -> {
            setCurrentCategoryIndex(SHORTCUT_INPUT_INDEX);
            populateKeyboardShortcutSearchList(keyboardShortcutsView.findViewById(
                    R.id.keyboard_shortcuts_container));
            populateKeyboardShortcutSearchList(shortcutsContainer);
            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                    R.string.keyboard_shortcut_a11y_filter_input));
        });

        mButtonOpenApps.setOnClickListener(v -> {
            setCurrentCategoryIndex(SHORTCUT_OPENAPPS_INDEX);
            populateKeyboardShortcutSearchList(keyboardShortcutsView.findViewById(
                    R.id.keyboard_shortcuts_container));
            populateKeyboardShortcutSearchList(shortcutsContainer);
            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                    R.string.keyboard_shortcut_a11y_filter_open_apps));
        });

        mButtonSpecificApp.setOnClickListener(v -> {
            setCurrentCategoryIndex(SHORTCUT_SPECIFICAPP_INDEX);
            populateKeyboardShortcutSearchList(keyboardShortcutsView.findViewById(
                    R.id.keyboard_shortcuts_container));
            populateKeyboardShortcutSearchList(shortcutsContainer);
            shortcutsContainer.setAccessibilityPaneTitle(mContext.getString(
                    R.string.keyboard_shortcut_a11y_filter_current_app));
        });

        mFullButtonList.add(mButtonSystem);