[Android] Fix snackbar deletion message in playlist #2285
Mohit Mandalia
git at videolan.org
Fri Jan 14 05:49:53 UTC 2022
vlc-android | branch: master | Mohit Mandalia <mohitmandalia2008 at gmail.com> | Fri Jan 14 05:49:51 2022 +0000| [ea5e6d707117534078bf12a002757e038688fb78] | committer: Nicolas Pomepuy
Fix snackbar deletion message in playlist #2285
> https://code.videolan.org/videolan/vlc-android/commit/ea5e6d707117534078bf12a002757e038688fb78
---
application/resources/src/main/res/values/strings.xml | 1 -
application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt | 5 +++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index f72c836e9..8355222f5 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -58,7 +58,6 @@
<string name="confirm_delete_files">Delete these %1$s files?</string>
<string name="confirm_delete_folders_and_files">Delete these %1$s folders and %2$s files?</string>
<string name="confirm_delete_playlist">Delete playlist \'%1$s\'?</string>
- <string name="confirm_remove_from_playlist">Remove \'%1$s\' from playlist?</string>
<string name="ringtone_set">The file \'%1$s\' was set as the ringtone.</string>
<string name="ringtone_error">An error occurred while setting the ringtone.</string>
<string name="pause">Pause</string>
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 1a97edf9f..89b4818e1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
@@ -402,7 +402,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
private fun removeItem(position: Int, media: MediaWrapper) {
if (isPlaylist) {
- snackerConfirm(this, getString(R.string.confirm_remove_from_playlist, media.title)) { (viewModel.playlist as Playlist).remove(position) }
+ removeFromPlaylist(listOf(media), listOf(position))
} else {
removeItems(listOf(media))
}
@@ -453,7 +453,8 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
playlist.remove(playlistIndex - index)
}
}
- UiTools.snackerWithCancel(this at PlaylistActivity, getString(R.string.removed_from_playlist_anonymous), action = {}) {
+ var removedMessage = if (indexes.size>1) getString(R.string.removed_from_playlist_anonymous) else getString(R.string.remove_playlist_item,list.first().title)
+ UiTools.snackerWithCancel(this at PlaylistActivity, removedMessage, action = {}) {
for ((key, value) in itemsRemoved) {
playlist.add(value, key)
}
More information about the Android
mailing list