[Android] Fix build

Geoffrey Métais git at videolan.org
Tue Apr 2 16:59:57 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Apr  2 14:44:27 2019 +0200| [cbc27f2a37be731620d2c600d1e8eef16e49d7dd] | committer: Geoffrey Métais

Fix build

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

 vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java         | 6 +++---
 vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java   | 1 +
 vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt | 4 ++--
 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java  | 4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
index 7e46b58f3..a60c0c0fc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
@@ -366,7 +366,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
                     @Override
                     public void run() {
                         if (mIsPlaylist) ((Playlist) mPlaylist).remove(position);
-                        else removeItem(media);
+                        else removeItem(position, media);
                     }
                 });
                 break;
@@ -386,13 +386,13 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
 
     }
 
-    private void removeItem(final MediaWrapper media) {
+    private void removeItem(final int position, final MediaWrapper media) {
         final int resId = mIsPlaylist ? R.string.confirm_remove_from_playlist : R.string.confirm_delete;
         if (mIsPlaylist) {
             UiTools.snackerConfirm(mBinding.getRoot(), getString(resId, media.getTitle()), new Runnable() {
                 @Override
                 public void run() {
-                    ((Playlist) mPlaylist).remove(media.getId());
+                    ((Playlist) mPlaylist).remove(position);
                 }
             });
         } else {
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java b/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
index 9da878a57..52939600e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
@@ -31,6 +31,7 @@ import android.view.View;
 
 import com.google.android.material.tabs.TabLayout;
 
+import org.jetbrains.annotations.NotNull;
 import org.videolan.medialibrary.media.MediaLibraryItem;
 import org.videolan.medialibrary.media.MediaWrapper;
 import org.videolan.vlc.R;
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt b/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
index 8422dc900..22addd795 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
@@ -127,8 +127,8 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
             tracks = if (addTracks) {
                 mNewTrack
             } else {//Save a playlist
-                for (mw in playlist.tracks) {
-                    playlist.remove(mw.id)
+                for (index in 0 until playlist.tracks.size) {
+                    playlist.remove(index)
                 }
                 mTracks
             }
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index e9eb98713..d0ade068a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -37,6 +37,7 @@ import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 
+import org.jetbrains.annotations.NotNull;
 import org.videolan.medialibrary.Medialibrary;
 import org.videolan.medialibrary.media.Folder;
 import org.videolan.medialibrary.media.MediaLibraryItem;
@@ -400,8 +401,7 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosModel> impleme
     }
 
     @Override
-    public void onImageClick(@NotNull View v, int position, @NotNull MediaLibraryItem item) {
-    }
+    public void onImageClick(@NotNull View v, int position, @NotNull MediaLibraryItem item) {}
 
     @Override
     public void onCtxClick(View v, int position, MediaLibraryItem item) {



More information about the Android mailing list