Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ViewCompat.setAccessibilityDelegate(itemView, object: AccessibilityDelegateCompat() {
override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfoCompat) {
super.onInitializeAccessibilityNodeInfo(host, info)
info.addAction(AccessibilityActionCompat(R.id.play_video, "play video"))
}
override fun performAccessibilityAction(host: View?, action: Int, args: Bundle?): Boolean {
if (action == R.id.play_video) {
// TODO: take action
return true;
}
return super.performAccessibilityAction(host, action, args)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.