Skip to content
Snippets Groups Projects
Commit 45e83d13 authored by Mohit Mandalia's avatar Mohit Mandalia Committed by Nicolas Pomepuy
Browse files

Fix snackbar deletion message in playlist

Fixes #2285
parent 8801a8f8
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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@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@PlaylistActivity, removedMessage, action = {}) {
for ((key, value) in itemsRemoved) {
playlist.add(value, key)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment