[Android] Fix selection erased when removing current track

Geoffrey Métais git at videolan.org
Wed Jan 31 15:36:46 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 31 14:00:57 2018 +0100| [a00e6f1dbc95c9f3526af5a5754f7a06ce576c3f] | committer: Geoffrey Métais

Fix selection erased when removing current track

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

 vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.java
index 463f37315..41d76720c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.java
@@ -124,8 +124,8 @@ public class PlaylistAdapter extends DiffUtilAdapter<MediaWrapper, PlaylistAdapt
 
     @MainThread
     public void remove(int position) {
-        if (mService == null)
-            return;
+        if (mService == null) return;
+        if (position == mCurrentIndex) mCurrentIndex = -1;
         mService.remove(position);
     }
 



More information about the Android mailing list