[Android] Make "stop after this" cancellable and remove the checkbox in video mode

Nicolas Pomepuy git at videolan.org
Fri Oct 20 12:01:31 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 10 09:39:13 2023 +0200| [c104de31d954a82307403239eb791c6dbade29fd] | committer: Duncan McNamara

Make "stop after this" cancellable and remove the checkbox in video mode

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

 application/vlc-android/res/menu/video_playqueue_item.xml         | 4 +---
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt         | 8 +++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/application/vlc-android/res/menu/video_playqueue_item.xml b/application/vlc-android/res/menu/video_playqueue_item.xml
index e4ac0a0464..c0cee2da40 100644
--- a/application/vlc-android/res/menu/video_playqueue_item.xml
+++ b/application/vlc-android/res/menu/video_playqueue_item.xml
@@ -10,7 +10,5 @@
     </group>
     <item
             android:id="@+id/stop_after"
-            android:title="@string/stop_after_this"
-            android:checkable="true"
-            android:checked="false"/>
+            android:title="@string/stop_after_this"/>
 </menu>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 5a84051d37..2ca471aef1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -1727,9 +1727,6 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
     override fun onPopupMenu(view: View, position: Int, item: MediaWrapper?) {
         val popupMenu = PopupMenu(this, view)
         popupMenu.menuInflater.inflate(R.menu.video_playqueue_item, popupMenu.menu)
-        if (position == service?.playlistManager?.stopAfter) {
-            popupMenu.menu.findItem(R.id.stop_after).isChecked = true
-        }
         if (isTablet() || AndroidDevices.isTv) {
             popupMenu.menu.removeGroup(R.id.phone_only)
         }
@@ -1741,8 +1738,9 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
                     return at OnMenuItemClickListener true
                 }
                 R.id.stop_after -> {
-                    playlistModel?.stopAfter(position)
-                    overlayDelegate.playlistAdapter.stopAfter = position
+                    val pos = if (playlistModel?.service?.playlistManager?.stopAfter != position) position else -1
+                    playlistModel?.stopAfter(pos)
+                    overlayDelegate.playlistAdapter.stopAfter = pos
                     curentItem.isChecked = true
                 }
             }



More information about the Android mailing list