[Android] Remove the useless checkbox in the jump to time dialog

Nicolas Pomepuy git at videolan.org
Tue Jun 11 14:50:38 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri May 24 08:50:14 2024 +0200| [7a7ad100e0b1b76a4be392977000bdfe70e328da] | committer: Nicolas Pomepuy

Remove the useless checkbox in the jump to time dialog

> https://code.videolan.org/videolan/vlc-android/commit/7a7ad100e0b1b76a4be392977000bdfe70e328da
---

 .../src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.kt            | 2 ++
 .../src/org/videolan/vlc/gui/dialogs/PickTimeFragment.kt            | 6 ++++++
 .../src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.kt            | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.kt
index 163e91339b..56779df021 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/JumpToTimeDialog.kt
@@ -34,6 +34,8 @@ class JumpToTimeDialog : PickTimeFragment() {
         dismiss()
     }
 
+    override fun showTimeOnly() = true
+
     override fun getTitle(): Int {
         return R.string.jump_to_time
     }
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.kt
index d43c814c43..d20e0e105c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.kt
@@ -32,6 +32,7 @@ import androidx.lifecycle.lifecycleScope
 import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED
 import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.flow.onEach
+import org.videolan.tools.setGone
 import org.videolan.vlc.PlaybackService
 import org.videolan.vlc.R
 import org.videolan.vlc.databinding.AudioBrowserBinding
@@ -53,6 +54,8 @@ abstract class PickTimeFragment : VLCBottomSheetDialogFragment(), View.OnClickLi
 
     lateinit var playbackService: PlaybackService
 
+    abstract fun showTimeOnly(): Boolean
+
     abstract fun getTitle(): Int
 
     open fun showDeleteCurrent() = false
@@ -80,6 +83,9 @@ abstract class PickTimeFragment : VLCBottomSheetDialogFragment(), View.OnClickLi
         binding.timPicDeleteCurrent.onFocusChangeListener = this
 
         mTextColor = binding.timPicTimetojump.currentTextColor
+        if (showTimeOnly()) {
+            binding.timPicWaitCheckbox.setGone()
+        }
 
         return binding.root
     }
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.kt
index 2d4bb0f7a9..a2c7614e9a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SleepTimerDialog.kt
@@ -42,6 +42,8 @@ class SleepTimerDialog : PickTimeFragment() {
     private lateinit var settings: SharedPreferences
     private val playlistModel by lazy { PlaylistModel.get(this) }
 
+    override fun showTimeOnly() = false
+
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View? {
         val view = super.onCreateView(inflater, container, savedInstanceState)



More information about the Android mailing list