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

Commit 03bf4ee6 authored by Ats Jenk's avatar Ats Jenk
Browse files

Update action text for expanding or collapsing menu

When focusing on the app handle for a bubble, the talkback text for
click action said: "double-tap to activate". Same for the first item in
the menu.
These both items are used to either expand or collapse the menu.
Update the click action label for app handle to say "double-tap to
expand menu" and first menu item to say "double-tap to collapse menu".

Bug: 344674311
Flag: com.android.wm.shell.enable_bubble_bar
Test: focus on app handle for a bubble, check the talkback text for
  click action
Test: focus on first bubble handle menu item, check the talkback text
  for click action
Change-Id: Idec815c625eac49e74d2a8420cbc8ef6385f08cb
parent a83842cd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@
    <string name="bubble_accessibility_action_move_bottom_left">Move bottom left</string>
    <!-- Action in accessibility menu to move the stack of bubbles to the bottom right of the screen. [CHAR LIMIT=30]-->
    <string name="bubble_accessibility_action_move_bottom_right">Move bottom right</string>
    <!-- Click action label for bubbles to expand menu. [CHAR LIMIT=30]-->
    <string name="bubble_accessibility_action_expand_menu">expand menu</string>
    <!-- Click action label for bubbles to collapse menu. [CHAR LIMIT=30]-->
    <string name="bubble_accessibility_action_collapse_menu">collapse menu</string>
    <!-- Accessibility announcement when the stack of bubbles expands. [CHAR LIMIT=NONE]-->
    <string name="bubble_accessibility_announce_expand">expand <xliff:g id="bubble_title" example="Messages">%1$s</xliff:g></string>
    <!-- Accessibility announcement when the stack of bubbles collapses. [CHAR LIMIT=NONE]-->
+12 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;

import com.android.wm.shell.R;
@@ -188,6 +189,17 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView

            // Handle view needs to draw on top of task view.
            bringChildToFront(mHandleView);

            mHandleView.setAccessibilityDelegate(new AccessibilityDelegate() {
                @Override
                public void onInitializeAccessibilityNodeInfo(View host,
                        AccessibilityNodeInfo info) {
                    super.onInitializeAccessibilityNodeInfo(host, info);
                    info.addAction(new AccessibilityNodeInfo.AccessibilityAction(
                            AccessibilityNodeInfo.ACTION_CLICK, getResources().getString(
                            R.string.bubble_accessibility_action_expand_menu)));
                }
            });
        }
        mMenuViewController = new BubbleBarMenuViewController(mContext, this);
        mMenuViewController.setListener(new BubbleBarMenuViewController.Listener() {
+12 −0
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@ import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -71,6 +73,16 @@ public class BubbleBarMenuView extends LinearLayout {
        mBubbleTitleView = findViewById(R.id.bubble_bar_manage_menu_bubble_title);
        mBubbleDismissIconView = findViewById(R.id.bubble_bar_manage_menu_dismiss_icon);
        updateThemeColors();

        mBubbleSectionView.setAccessibilityDelegate(new AccessibilityDelegate() {
            @Override
            public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
                super.onInitializeAccessibilityNodeInfo(host, info);
                info.addAction(new AccessibilityNodeInfo.AccessibilityAction(
                        AccessibilityNodeInfo.ACTION_CLICK, getResources().getString(
                        R.string.bubble_accessibility_action_collapse_menu)));
            }
        });
    }

    private void updateThemeColors() {