[Android] Accessibility: add the video played state
Nicolas Pomepuy
git at videolan.org
Mon Jun 27 11:45:16 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jun 27 07:28:05 2022 +0200| [620bde5816b5f19a6eb0c2572a97a56e03447ac0] | committer: Duncan McNamara
Accessibility: add the video played state
> https://code.videolan.org/videolan/vlc-android/commit/620bde5816b5f19a6eb0c2572a97a56e03447ac0
---
application/resources/src/main/res/values/strings.xml | 1 +
.../vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.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 3d5913363..f547f5fa7 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -1032,6 +1032,7 @@
<string name="talkback_action_rewind">Rewind %s seconds</string>
<string name="talkback_action_forward">Seek forward %s seconds</string>
<string name="talkback_display_settings">Display settings</string>
+ <string name="talkback_already_played">Already played</string>
</resources>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
index 5b39bb1f5..6943db3e4 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
@@ -35,9 +35,11 @@ object TalkbackUtil {
fun getDuration(context: Context, duration: Long) = context.getString(R.string.talkback_duration, millisToString(context, duration))
fun getDuration(context: Context, duration: String) = context.getString(R.string.talkback_duration, duration)
+ fun getPlayed(context: Context, video: MediaWrapper) = if (video.playCount > 0) context.getString(R.string.talkback_already_played) else null
fun getAlbumTitle(context: Context, album: String) = context.getString(R.string.talkback_album, album)
fun getReleaseDate(context: Context, date: String?) = if (date == null) "" else context.getString(R.string.talkback_release_date, date)
fun getVideo(context: Context, video: MediaWrapper) = context.getString(R.string.talkback_video, video.title)
+ .talkbackAppend(getPlayed(context, video))
.talkbackAppend(getDuration(context, millisToString(context, video.length)))
fun getStream(context: Context, stream: MediaWrapper) = context.getString(R.string.talkback_stream, stream.title)
More information about the Android
mailing list