[Android] Disable swipe for lists that are not playlist

Nicolas Pomepuy git at videolan.org
Thu Jul 4 15:43:52 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Jul  4 08:48:42 2019 +0200| [6bc0a7b864b7cd4c3a699a7d3242c05f7721106b] | committer: Geoffrey Métais

Disable swipe for lists that are not playlist

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

 vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
index 55b9a9539..63d53b9c9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
@@ -54,7 +54,6 @@ import org.videolan.medialibrary.media.MediaLibraryItem
 import org.videolan.tools.isStarted
 import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.R
-import org.videolan.vlc.VLCApplication
 import org.videolan.vlc.databinding.PlaylistActivityBinding
 import org.videolan.vlc.gui.audio.AudioBrowserAdapter
 import org.videolan.vlc.gui.audio.AudioBrowserFragment
@@ -120,8 +119,10 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler, IL
             }
         })
         audioBrowserAdapter = AudioBrowserAdapter(MediaLibraryItem.TYPE_MEDIA, this, this, isPlaylist)
-        itemTouchHelper = ItemTouchHelper(SwipeDragItemTouchHelperCallback(audioBrowserAdapter))
-        itemTouchHelper!!.attachToRecyclerView(binding.songs)
+        if (isPlaylist) {
+            itemTouchHelper = ItemTouchHelper(SwipeDragItemTouchHelperCallback(audioBrowserAdapter))
+            itemTouchHelper!!.attachToRecyclerView(binding.songs)
+        }
 
         binding.songs.layoutManager = LinearLayoutManager(this)
         binding.songs.adapter = audioBrowserAdapter



More information about the Android mailing list