[Android] Remove dead code

Nicolas Pomepuy git at videolan.org
Wed Jan 20 09:54:27 UTC 2021


vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jan  7 07:30:59 2021 +0100| [0b2e017ae6d59cb6f0aaa533459cfc29f7442d15] | committer: Nicolas Pomepuy

Remove dead code

(cherry picked from commit 5a55008132491be8bc9b97a386868be35a1d5171)

> https://code.videolan.org/videolan/vlc-android/commit/0b2e017ae6d59cb6f0aaa533459cfc29f7442d15
---

 .../src/main/java/org/videolan/resources/Constants.kt       |  1 -
 application/resources/src/main/res/values/attrs.xml         |  1 -
 application/vlc-android/res/values/styles.xml               |  3 ---
 .../src/org/videolan/vlc/gui/dialogs/ContextSheet.kt        | 13 ++++++++++++-
 .../org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt   | 13 -------------
 5 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/application/resources/src/main/java/org/videolan/resources/Constants.kt b/application/resources/src/main/java/org/videolan/resources/Constants.kt
index 521221632..d2886062c 100644
--- a/application/resources/src/main/java/org/videolan/resources/Constants.kt
+++ b/application/resources/src/main/java/org/videolan/resources/Constants.kt
@@ -192,7 +192,6 @@ const val CTX_STOP_AFTER_THIS = 1L shl 18
 const val CTX_RENAME = 1L shl 19
 const val CTX_AUDIO_TRACK = 1L shl 20
 const val CTX_SUBS_TRACK = 1L shl 21
-const val CTX_PICK_SUBS = 1L shl 22
 const val CTX_VIDEO_TRACK = 1L shl 23
 const val CTX_DOWNLOAD_SUBTITLES_PLAYER = 1L shl 24
 const val CTX_ADD_SCANNED = 1L shl 25
diff --git a/application/resources/src/main/res/values/attrs.xml b/application/resources/src/main/res/values/attrs.xml
index 7697fbd24..62be9d0d0 100644
--- a/application/resources/src/main/res/values/attrs.xml
+++ b/application/resources/src/main/res/values/attrs.xml
@@ -91,7 +91,6 @@
     <attr name="ic_chapter_normal_style" format="reference" />
     <attr name="ic_equalizer_normal_style" format="reference" />
     <attr name="ic_audiodelay" format="reference" />
-    <attr name="ic_subtitledelay" format="reference" />
     <attr name="ic_playasaudio_off" format="reference" />
     <attr name="ic_playasaudio_on" format="reference" />
     <attr name="ic_popup_expand" format="reference" />
diff --git a/application/vlc-android/res/values/styles.xml b/application/vlc-android/res/values/styles.xml
index 45451f8c8..2fce1c084 100644
--- a/application/vlc-android/res/values/styles.xml
+++ b/application/vlc-android/res/values/styles.xml
@@ -100,7 +100,6 @@
         <item name="ic_chapter_normal_style">@drawable/ic_chapter</item>
         <item name="ic_equalizer_normal_style">@drawable/ic_equalizer</item>
         <item name="ic_audiodelay">@drawable/ic_audiodelay</item>
-        <item name="ic_subtitledelay">@drawable/ic_subtitledelay</item>
         <item name="ic_passthrough">@drawable/ic_passthrough</item>
         <item name="ic_abrepeat">@drawable/ic_abrepeat</item>
         <item name="ic_abrepeat_reset">@drawable/ic_abrepeat_reset</item>
@@ -235,7 +234,6 @@
         <item name="ic_chapter_normal_style">@drawable/ic_chapter_w</item>
         <item name="ic_equalizer_normal_style">@drawable/ic_equalizer_w</item>
         <item name="ic_audiodelay">@drawable/ic_audiodelay_w</item>
-        <item name="ic_subtitledelay">@drawable/ic_subtitledelay_w</item>
         <item name="ic_passthrough">@drawable/ic_passthrough_w</item>
         <item name="ic_abrepeat">@drawable/ic_abrepeat</item>
         <item name="ic_abrepeat_reset">@drawable/ic_abrepeat_reset</item>
@@ -410,7 +408,6 @@
         <item name="ic_chapter_normal_style">@drawable/ic_chapter_w</item>
         <item name="ic_equalizer_normal_style">@drawable/ic_equalizer_w</item>
         <item name="ic_audiodelay">@drawable/ic_audiodelay_w</item>
-        <item name="ic_subtitledelay">@drawable/ic_subtitledelay_w</item>
         <item name="ic_passthrough">@drawable/ic_passthrough_w</item>
         <item name="ic_trash">@drawable/ic_trash_w</item>
         <item name="ic_reset">@drawable/ic_reset_w</item>
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 6f5b26a9c..bdd29b084 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
@@ -94,7 +94,18 @@ class ContextSheet : VLCBottomSheetDialogFragment() {
         if (flags and CTX_VIDEO_TRACK != 0L) add(Simple(CTX_VIDEO_TRACK, getString(R.string.ctx_player_video_track), R.drawable.ic_ctx_information))
         if (flags and CTX_AUDIO_TRACK != 0L) add(Simple(CTX_AUDIO_TRACK, getString(R.string.ctx_player_audio_track), R.drawable.ic_audiotrack_normal))
         if (flags and CTX_SUBS_TRACK != 0L) add(Simple(CTX_SUBS_TRACK, getString(R.string.ctx_player_subs_track), R.drawable.ic_subtitle_w))
-        if (flags and CTX_PICK_SUBS != 0L) add(Simple(CTX_PICK_SUBS, getString(R.string.subtitle_select), R.drawable.ic_subtitle_open_w))
+        if (flags and CTX_APPEND != 0L) add(Simple(CTX_APPEND, getString(R.string.append), R.drawable.ic_ctx_append))
+        if (flags and CTX_INFORMATION != 0L) add(Simple(CTX_INFORMATION, getString(R.string.info), R.drawable.ic_ctx_information))
+        if (flags and CTX_DOWNLOAD_SUBTITLES != 0L) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_ctx_download_subtitles))
+        if (flags and CTX_DOWNLOAD_SUBTITLES_PLAYER != 0L) add(Simple(CTX_DOWNLOAD_SUBTITLES_PLAYER, getString(R.string.download_subtitles), R.drawable.ic_downsub_normal))
+        if (flags and CTX_PLAY_NEXT != 0L) add(Simple(CTX_PLAY_NEXT, getString(R.string.insert_next), R.drawable.ic_ctx_play_next))
+        if (flags and CTX_ADD_TO_PLAYLIST != 0L) add(Simple(CTX_ADD_TO_PLAYLIST, getString(R.string.add_to_playlist), R.drawable.ic_ctx_add_to_playlist))
+        if (flags and CTX_SET_RINGTONE != 0L && AndroidDevices.isPhone) add(Simple(CTX_SET_RINGTONE, getString(R.string.set_song), R.drawable.ic_ctx_set_ringtone))
+        if (flags and CTX_FAV_ADD != 0L) add(Simple(CTX_FAV_ADD, getString(R.string.favorites_add), R.drawable.ic_ctx_fav_add))
+        if (flags and CTX_ADD_SCANNED != 0L) add(Simple(CTX_ADD_SCANNED, getString(R.string.add_to_scanned), R.drawable.ic_ctx_addtoscan))
+        if (flags and CTX_FAV_EDIT != 0L) add(Simple(CTX_FAV_EDIT, getString(R.string.favorites_edit), R.drawable.ic_ctx_fav_edit))
+        if (flags and CTX_FAV_REMOVE != 0L) add(Simple(CTX_FAV_REMOVE, getString(R.string.favorites_remove), R.drawable.ic_ctx_fav_remove))
+        if (flags and CTX_REMOVE_FROM_PLAYLIST != 0L) add(Simple(CTX_REMOVE_FROM_PLAYLIST, getString(R.string.remove), R.drawable.ic_ctx_remove_from_playlist))
         if (flags and CTX_APPEND != 0L) add(Simple(CTX_APPEND, getString(R.string.append), R.drawable.ic_ctx_append))
         if (flags and CTX_INFORMATION != 0L) add(Simple(CTX_INFORMATION, getString(R.string.info), R.drawable.ic_ctx_information))
         if (flags and CTX_DOWNLOAD_SUBTITLES != 0L) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_ctx_download_subtitles))
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 4e218f2a7..afa7c5e27 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -47,7 +47,6 @@ private const val ID_PLAY_AS_AUDIO = 0L
 private const val ID_SLEEP = 1L
 private const val ID_JUMP_TO = 2L
 private const val ID_AUDIO_DELAY = 3L
-private const val ID_SPU_DELAY = 4L
 private const val ID_CHAPTER_TITLE = 5L
 private const val ID_PLAYBACK_SPEED = 6L
 private const val ID_EQUALIZER = 7L
@@ -312,17 +311,6 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
         }
     }
 
-    private fun initSpuDelay(binding: PlayerOptionItemBinding) {
-        val spudelay = service.spuDelay / 1000L
-        if (spudelay == 0L) {
-            binding.optionTitle.text = null
-            binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, R.attr.ic_subtitledelay))
-        } else {
-            binding.optionTitle.text = String.format("%s ms", spudelay.toString())
-            binding.optionIcon.setImageResource(R.drawable.ic_subtitledelay_on)
-        }
-    }
-
     private fun initRepeat(binding: PlayerOptionItemBinding) {
         repeatBinding = binding
         AppScope.launch(Dispatchers.Main) {
@@ -370,7 +358,6 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
                 option.id == ID_PLAYBACK_SPEED -> initPlaybackSpeed(holder.binding)
                 option.id == ID_AUDIO_DELAY -> initAudioDelay(holder.binding)
                 option.id == ID_JUMP_TO -> initJumpTo(holder.binding)
-                option.id == ID_SPU_DELAY -> initSpuDelay(holder.binding)
             }
             holder.binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, option.icon))
         }



More information about the Android mailing list