Customising accessibility in recyclerview using onPopulateAccessibilityEvent and AccessibilityDelegate
问题 I'm trying to customise the talkback output for items in a RecyclerView. I have modified the onBindViewHolder method to include the following code itemView?.setAccessibilityDelegate(object: View.AccessibilityDelegate() { override fun onPopulateAccessibilityEvent(host: View?, event: AccessibilityEvent?) { super.onPopulateAccessibilityEvent(host, event) event?.let {event -> if (event.eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) { event.text.add("Hello world!") } } } })