[Android] VlcMigration: fix move obsolete version helpers
Duncan McNamara
git at videolan.org
Fri Nov 29 05:53:44 UTC 2024
vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Nov 28 14:54:18 2024 +0100| [c8ffdc2cfbf527536edcbef34cf40606b951ffcc] | committer: Duncan McNamara
VlcMigration: fix move obsolete version helpers
On 757baf34355ded7e0d614faa093873161dfb9640 I forgot two instances.
> https://code.videolan.org/videolan/vlc-android/commit/c8ffdc2cfbf527536edcbef34cf40606b951ffcc
---
.../vlc-android/src/org/videolan/vlc/gui/dialogs/ContextSheet.kt | 4 +++-
.../vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/ContextSheet.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/ContextSheet.kt
index 812d012a41..745ed7037a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/ContextSheet.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/ContextSheet.kt
@@ -38,6 +38,7 @@ import org.videolan.medialibrary.media.MediaLibraryItem
import org.videolan.resources.AndroidDevices
import org.videolan.tools.isStarted
import org.videolan.vlc.R
+import org.videolan.vlc.VlcMigrationHelper
import org.videolan.vlc.databinding.ContextItemBinding
import org.videolan.vlc.databinding.ContextualSheetBinding
import org.videolan.vlc.util.ContextOption
@@ -111,6 +112,7 @@ class ContextSheet : VLCBottomSheetDialogFragment() {
}
private fun populateMenuItems(flags: FlagSet<ContextOption>) = mutableListOf<CtxMenuItem>().apply {
+
if (flags.contains(CTX_PLAY)) add(Simple(CTX_PLAY, getString(R.string.play), R.drawable.ic_play))
if (flags.contains(CTX_PLAY_SHUFFLE)) add(Simple(CTX_PLAY_SHUFFLE, getString(R.string.shuffle_play), R.drawable.ic_shuffle))
if (flags.contains(CTX_PLAY_FROM_START)) add(Simple(CTX_PLAY_FROM_START, getString(R.string.play_from_start), R.drawable.ic_play_from_start))
@@ -118,7 +120,7 @@ class ContextSheet : VLCBottomSheetDialogFragment() {
if (flags.contains(CTX_PLAY_AS_AUDIO)) add(Simple(CTX_PLAY_AS_AUDIO, getString(R.string.play_as_audio), R.drawable.ic_play_as_audio))
if (flags.contains(CTX_APPEND)) add(Simple(CTX_APPEND, getString(R.string.append), R.drawable.ic_play_append))
if (flags.contains(CTX_PLAY_NEXT)) add(Simple(CTX_PLAY_NEXT, getString(R.string.insert_next), R.drawable.ic_play_next))
- if (flags.contains(CTX_DOWNLOAD_SUBTITLES) && AndroidUtil.isLolliPopOrLater) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_download_subtitles))
+ if (flags.contains(CTX_DOWNLOAD_SUBTITLES) && VlcMigrationHelper.isLolliPopOrLater) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_download_subtitles))
if (flags.contains(CTX_INFORMATION)) add(Simple(CTX_INFORMATION, getString(R.string.info), R.drawable.ic_information))
if (flags.contains(CTX_GO_TO_ALBUM)) add(Simple(CTX_GO_TO_ALBUM, getString(R.string.go_to_album), R.drawable.ic_album))
if (flags.contains(CTX_GO_TO_ARTIST)) add(Simple(CTX_GO_TO_ARTIST, getString(R.string.go_to_artist), R.drawable.ic_no_artist))
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
index e174093903..8602acebf1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
@@ -45,6 +45,7 @@ import org.videolan.tools.setGone
import org.videolan.tools.setVisible
import org.videolan.vlc.PlaybackService
import org.videolan.vlc.R
+import org.videolan.vlc.VlcMigrationHelper
import org.videolan.vlc.databinding.PlayerOverlayTracksBinding
import org.videolan.vlc.getDisableTrack
import org.videolan.vlc.gui.dialogs.adapters.TrackAdapter
@@ -162,7 +163,7 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
generateSeparator(binding.subtitleTracks.options)
generateOptionItem(binding.subtitleTracks.options, getString(R.string.spu_delay), R.drawable.ic_delay, VideoTrackOption.SUB_DELAY)
generateOptionItem(binding.subtitleTracks.options, getString(R.string.subtitle_select), R.drawable.ic_subtitles_file, VideoTrackOption.SUB_PICK)
- if (AndroidUtil.isLolliPopOrLater) generateOptionItem(binding.subtitleTracks.options, getString(R.string.download_subtitles), R.drawable.ic_download_subtitles, VideoTrackOption.SUB_DOWNLOAD)
+ if (VlcMigrationHelper.isLolliPopOrLater) generateOptionItem(binding.subtitleTracks.options, getString(R.string.download_subtitles), R.drawable.ic_download_subtitles, VideoTrackOption.SUB_DOWNLOAD)
generateSeparator(binding.subtitleTracks.options, true)
binding.subtitleTracks.options.setAnimationUpdateListener {
binding.subtitleTracks.trackMore.rotation = if (binding.subtitleTracks.options.isCollapsed) 180F - (180F * it) else 180F * it
More information about the Android
mailing list