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

Commit 8af16760 authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Update accessibility for popup" into ub-launcher3-dorval

parents 904a3834 18c4aa45
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -133,4 +133,5 @@
    <item type="id" name="action_move_screen_forwards" />
    <item type="id" name="action_resize" />
    <item type="id" name="action_deep_shortcuts" />
    <item type="id" name="action_dismiss_notification" />
</resources>
+8 −0
Original line number Diff line number Diff line
@@ -292,5 +292,13 @@

    <!-- Accessibility description for the shortcuts menu shown for an app. -->
    <string name="shortcuts_menu_description"><xliff:g id="number_of_shortcuts" example="3">%1$d</xliff:g> shortcuts for <xliff:g id="app_name" example="Messenger">%2$s</xliff:g></string>
    <!-- Accessibility description when the shortcuts menu has notifications as well as shortcuts. -->
    <string name="shortcuts_menu_with_notifications_description"><xliff:g id="number_of_shortcuts" example="3">%1$d</xliff:g> shortcuts and <xliff:g id="number_of_notifications" example="3">%2$d</xliff:g> notifications for <xliff:g id="app_name" example="Messenger">%3$s</xliff:g></string>

    <!-- Accessibility action to dismiss a notification in the shortcuts menu for an icon. [CHAR_LIMIT=30] -->
    <string name="action_dismiss_notification">Dismiss</string>

    <!-- Accessibility confirmation for notification being dismissed. -->
    <string name="notification_dismissed">Notification dismissed</string>

</resources>
+0 −8
Original line number Diff line number Diff line
@@ -659,14 +659,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
        }
    }

    /**
     * Returns true if the view can show custom shortcuts.
     */
    public boolean hasDeepShortcuts() {
        return !mLauncher.getPopupDataProvider().getShortcutIdsForItem((ItemInfo) getTag())
                .isEmpty();
    }

    /**
     * Interface to be implemented by the grand parent to allow click shadow effect.
     */
+2 −2
Original line number Diff line number Diff line
@@ -4061,8 +4061,8 @@ public class Launcher extends BaseActivity
            shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.custom_actions),
                    KeyEvent.KEYCODE_O, KeyEvent.META_CTRL_ON));
        }
        if (currentFocus instanceof BubbleTextView &&
                ((BubbleTextView) currentFocus).hasDeepShortcuts()) {
        if (currentFocus.getTag() instanceof ItemInfo
                && DeepShortcutManager.supportsShortcuts((ItemInfo) currentFocus.getTag())) {
            shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.action_deep_shortcut),
                    KeyEvent.KEYCODE_S, KeyEvent.META_CTRL_ON));
        }
+2 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.util.Thunk;

import java.util.ArrayList;
@@ -104,8 +105,7 @@ public class LauncherAccessibilityDelegate extends AccessibilityDelegate impleme

        // If the request came from keyboard, do not add custom shortcuts as that is already
        // exposed as a direct shortcut
        if (!fromKeyboard && host instanceof BubbleTextView
                && ((BubbleTextView) host).hasDeepShortcuts()) {
        if (!fromKeyboard && DeepShortcutManager.supportsShortcuts(item)) {
            info.addAction(mActions.get(DEEP_SHORTCUTS));
        }

Loading