Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do it disable message "double on tap" in view using talkback accessibility android?

When a view has event click and enable talkback. I need to disable the audio "double to tap" in the view.

I am using accessibility in android development.

How can I do this, please?

like image 632
fah127 Avatar asked Mar 11 '23 19:03

fah127


1 Answers

If you check google talkback source code at this line and here, string resource ("double tap") has been used here and here

So, you should remove AccessibilityActionCompat.ACTION_CLICK action and set isClickable to false in node info.

ViewCompat.setAccessibilityDelegate(view, object : AccessibilityDelegateCompat() {
        override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfoCompat) {
            super.onInitializeAccessibilityNodeInfo(host, info)
            info.removeAction(AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK)
            info.isClickable = false
        }
    })

I tested this and it should work.

like image 83
kiran puppala Avatar answered May 01 '23 17:05

kiran puppala