[Android] Accessibility: use the compat version of the AccessibilityDelegate
Nicolas Pomepuy
git at videolan.org
Fri Jun 3 11:30:22 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jun 2 15:56:43 2022 +0200| [f4b8da408a321ea7bfe2fdd045db2d9ba3099292] | committer: Nicolas Pomepuy
Accessibility: use the compat version of the AccessibilityDelegate
> https://code.videolan.org/videolan/vlc-android/commit/f4b8da408a321ea7bfe2fdd045db2d9ba3099292
---
.../vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
index 288f1e4f4..311e8de21 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
@@ -6,13 +6,15 @@ import android.util.Log
import android.view.View
import android.view.accessibility.AccessibilityEvent
import androidx.appcompat.widget.AppCompatSeekBar
+import androidx.core.view.AccessibilityDelegateCompat
+import androidx.core.view.ViewCompat
import org.videolan.resources.BuildConfig
import org.videolan.vlc.R
import org.videolan.vlc.gui.helpers.TalkbackUtil
class AccessibleSeekBar : AppCompatSeekBar {
- private val customAccessibilityDelegate = object : View.AccessibilityDelegate() {
+ private val customAccessibilityDelegate = object : AccessibilityDelegateCompat() {
var force = false
set(value) {
field = value
@@ -56,7 +58,7 @@ class AccessibleSeekBar : AppCompatSeekBar {
}
private fun initialize() {
- accessibilityDelegate = customAccessibilityDelegate
+ ViewCompat.setAccessibilityDelegate(this, customAccessibilityDelegate)
}
fun forceAccessibilityUpdate() {
More information about the Android
mailing list