[Android] Allow canceling the video play queue item swipe

Nicolas Pomepuy git at videolan.org
Fri Oct 20 12:21:51 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 10 10:07:08 2023 +0200| [1c07007fc900cb85101b332eb8f9322572b867f5] | committer: Duncan McNamara

Allow canceling the video play queue item swipe

Fixes #3002

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

 .../vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
index d1a9207859..aad8388c37 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
@@ -24,6 +24,7 @@
 package org.videolan.vlc.gui.audio
 
 import android.annotation.TargetApi
+import android.app.Activity
 import android.content.Context
 import android.graphics.Typeface
 import android.graphics.drawable.BitmapDrawable
@@ -33,7 +34,6 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.ImageView
-import android.widget.Toast
 import androidx.annotation.MainThread
 import androidx.constraintlayout.widget.ConstraintLayout
 import androidx.core.os.bundleOf
@@ -207,8 +207,10 @@ class PlaylistAdapter(private val player: IPlayer) : DiffUtilAdapter<MediaWrappe
             UiTools.snackerWithCancel(player.requireActivity(), message, overAudioPlayer = true, action = {}) {
                  model?.run { insertMedia(position, media) }
             }
-        } else if (player is Context) {
-            Toast.makeText(AppContextProvider.appContext, message, Toast.LENGTH_SHORT).show()
+        } else if (player is Activity) {
+            UiTools.snackerWithCancel(player, message, action = {}) {
+                model?.run { insertMedia(position, media) }
+            }
         }
         remove(position)
     }



More information about the Android mailing list