[Android] Accessibility: audio player playlist toggle improve content description
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 08:15:07 2022 +0200| [fb1b6f0926491970697495eef364fee7ee3e5b31] | committer: Nicolas Pomepuy
Accessibility: audio player playlist toggle improve content description
> https://code.videolan.org/videolan/vlc-android/commit/fb1b6f0926491970697495eef364fee7ee3e5b31
---
application/resources/src/main/res/values/strings.xml | 1 +
.../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt | 2 ++
2 files changed, 3 insertions(+)
diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index 1aa3b878b..4ca462875 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -254,6 +254,7 @@
<string name="audio_player_tips">Audio player tips</string>
<string name="previous_next_song">Previous/Next song</string>
<string name="show_playlist">Show playlist</string>
+ <string name="hide_playlist">Hide playlist</string>
<string name="hold_to_stop">Hold to stop</string>
<!-- About -->
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
index e98f216c6..aa9de5b2b 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
@@ -102,6 +102,8 @@ internal class AudioPlayerAnimator : IAudioPlayerAnimator, LifecycleObserver {
field = value
onSlide(1F)
binding.playlistSwitch.setImageResource(if (value) R.drawable.ic_playlist_audio else R.drawable.ic_playlist_audio_on)
+ binding.playlistSwitch.contentDescription = audioPlayer.getString(if (value) R.string.hide_playlist else R.string.show_playlist)
+ binding.playlistSwitch.announceForAccessibility(audioPlayer.getString(if (value) R.string.hide_playlist else R.string.show_playlist))
audioPlayer.setBottomMargin()
}
More information about the Android
mailing list