Accessibility live region - Android
On Android, a live region can be set by using the convience method setAccessibilityLiveRegion
of ViewCompat
. To interrupt ingoing speech, also known as being assertive, use ACCESSIBILITY_LIVE_REGION_ASSERTIVE
. To wait for ongoing speech, also known as being polite, use ACCESSIBILITY_LIVE_REGION_POLITE
.
// Interrupt ongoing speech
ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_ASSERTIVE)
// Wait for ongoing speech
ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_POLITE)