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

Commit d5745218 authored by Ben Lin's avatar Ben Lin
Browse files

Update Talkback text for app header "menu".

So now this is updated to "App Name - Double Tap to 'Open menu'. 'Open
Menu' is the text supplied by the string resource.

Bug: 329208268
Test: Manual. Turn Talkback on, focus on App Header for Settings - says
"Settings - Double tap to open menu".
Flag: EXEMPT bugfix
Change-Id: Id92aecb06676d5a63aba379f65db1a6af422d65b

Change-Id: I55104d3ae2cc3ee7b463644b9c054c5dd2aed052
parent 9d372069
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ class AppHeaderViewHolder(
    private val lightColors = dynamicLightColorScheme(context)
    private val darkColors = dynamicDarkColorScheme(context)

    private val headerButtonOpenMenuA11yText = context.resources
        .getString(R.string.desktop_mode_app_header_chip_text)

    /**
     * The corner radius to apply to the app chip, maximize and close button's background drawable.
     **/
@@ -228,6 +231,18 @@ class AppHeaderViewHolder(
            }
        }

        val a11yActionOpenHeaderMenu = AccessibilityAction(AccessibilityNodeInfo.ACTION_CLICK,
            headerButtonOpenMenuA11yText)
        openMenuButton.accessibilityDelegate = object : View.AccessibilityDelegate() {
            override fun onInitializeAccessibilityNodeInfo(
                host: View,
                info: AccessibilityNodeInfo
            ) {
                super.onInitializeAccessibilityNodeInfo(host, info)
                info.addAction(a11yActionOpenHeaderMenu)
            }
        }

        with(context.resources) {
            // Update a11y read out to say "double tap to maximize or restore window size"
            ViewCompat.replaceAccessibilityAction(
@@ -260,6 +275,7 @@ class AppHeaderViewHolder(
    /** Sets the app's name in the header. */
    fun setAppName(name: CharSequence) {
        appNameTextView.text = name
        openMenuButton.contentDescription = name
    }

    /** Sets the app's icon in the header. */