[Android] Fix delete track in artist screen delete dialog
Nicolas Pomepuy
git at videolan.org
Tue Jun 1 12:17:27 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon May 31 08:03:13 2021 +0200| [6e3c561682f689bf99949f21593f8d125482797a] | committer: Nicolas Pomepuy
Fix delete track in artist screen delete dialog
Fixes #2040
> https://code.videolan.org/videolan/vlc-android/commit/6e3c561682f689bf99949f21593f8d125482797a
---
.../vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
index 1b2f8329c..b09d96c4a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
@@ -394,12 +394,10 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
}
private fun removeItem(position: Int, media: MediaWrapper) {
- val resId = if (isPlaylist) R.string.confirm_remove_from_playlist else R.string.confirm_delete
if (isPlaylist) {
- snackerConfirm(this, getString(resId, media.title), Runnable { (viewModel.playlist as Playlist).remove(position) })
+ snackerConfirm(this, getString(R.string.confirm_remove_from_playlist, media.title), Runnable { (viewModel.playlist as Playlist).remove(position) })
} else {
- val deleteAction = Runnable { deleteMedia(media) }
- snackerConfirm(this, getString(resId, media.title), Runnable { if (Permissions.checkWritePermission(this at PlaylistActivity, media, deleteAction)) deleteAction.run() })
+ removeItems(listOf(media))
}
}
More information about the Android
mailing list