[Android] Accessibility: add a content description for FABs
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 07:04:38 2022 +0200| [a489f09ba11d41a8a0f88a95c3e0270e252d74fe] | committer: Nicolas Pomepuy
Accessibility: add a content description for FABs
> https://code.videolan.org/videolan/vlc-android/commit/a489f09ba11d41a8a0f88a95c3e0270e252d74fe
---
.../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.kt | 3 ++-
.../vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt | 1 +
.../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt | 1 +
.../src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt | 1 +
.../vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt | 1 +
5 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.kt
index 9f02d5b30..21ce00e38 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.kt
@@ -40,8 +40,8 @@ import org.videolan.tools.dp
import org.videolan.tools.putSingle
import org.videolan.vlc.R
import org.videolan.vlc.gui.ContentActivity
-import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.HeaderMediaListActivity
+import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.view.FastScroller
import org.videolan.vlc.gui.view.RecyclerSectionItemGridDecoration
import org.videolan.vlc.media.MediaUtils
@@ -127,6 +127,7 @@ class AudioAlbumsSongsFragment : BaseAudioBrowser<AlbumSongsViewModel>(), SwipeR
}
fabPlay?.setImageResource(R.drawable.ic_fab_play)
+ fabPlay?.contentDescription = getString(R.string.play)
viewModel.albumsProvider.pagedList.observe(requireActivity()) { albums ->
@Suppress("UNCHECKED_CAST")
(albums as? PagedList<MediaLibraryItem>)?.let { albumsAdapter.submitList(it) }
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
index 5c42a752a..aab8bea75 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
@@ -233,6 +233,7 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
super.onStart()
setFabPlayShuffleAllVisibility()
fabPlay?.setImageResource(R.drawable.ic_fab_shuffle)
+ fabPlay?.contentDescription = getString(R.string.shuffle_play)
}
override fun onPrepareOptionsMenu(menu: Menu) {
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 76327e9d8..9d266023e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -205,6 +205,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
fabPlay?.run {
setImageResource(R.drawable.ic_fab_play)
updateFab()
+ fabPlay?.contentDescription = getString(R.string.play)
}
(activity as? AudioPlayerContainerActivity)?.expandAppBar()
}
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
index 0f0fbe1b7..1ba46d60d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
@@ -100,6 +100,7 @@ class NetworkBrowserFragment : BaseBrowserFragment(), IDialogManager {
override fun onStart() {
super.onStart()
fabPlay?.setImageResource(if (isRootDirectory) R.drawable.ic_fab_add else R.drawable.ic_fab_play)
+ fabPlay?.contentDescription = getString(if (isRootDirectory) R.string.add else R.string.play)
fabPlay?.setOnClickListener(this)
}
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 6b09b6cd7..7973a58c3 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -243,6 +243,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
updateViewMode()
setFabPlayVisibility(true)
fabPlay?.setImageResource(R.drawable.ic_fab_play)
+ fabPlay?.contentDescription = getString(R.string.play)
if (!viewModel.isEmpty() && getFilterQuery() == null) viewModel.refresh()
}
More information about the Android
mailing list