Merge pull request #1288 from logicgupta/Confirm-add-to-playlist-#1283
Confirm add to playlist #1283
This commit is contained in:
commit
7f3b2b3d91
2 changed files with 27 additions and 9 deletions
|
@ -387,21 +387,36 @@ class LibraryViewModel(
|
||||||
it.toSongEntity(playListId = playlist.playListId)
|
it.toSongEntity(playListId = playlist.playListId)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
withContext(Main) {
|
}
|
||||||
Toast.makeText(
|
withContext(Main) {
|
||||||
App.getContext(),
|
when {
|
||||||
"Playlist already exists",
|
playlists.isEmpty() -> {
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
if (songs.isNotEmpty()) {
|
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
App.getContext(),
|
App.getContext(),
|
||||||
"Adding songs to $playlistName",
|
App.getContext()
|
||||||
|
.getString(R.string.playlist_created_sucessfully, playlistName),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
checkPlaylistExists(playlistName).isNotEmpty() -> {
|
||||||
|
Toast.makeText(
|
||||||
|
App.getContext(),
|
||||||
|
App.getContext().getString(R.string.playList_already_exits),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
playlists.isNotEmpty() -> {
|
||||||
|
Toast.makeText(
|
||||||
|
App.getContext(),
|
||||||
|
App.getContext().getString(
|
||||||
|
R.string.added_song_count_to_playlist,
|
||||||
|
songs.size,
|
||||||
|
playlistName
|
||||||
|
),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -546,6 +546,9 @@
|
||||||
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
||||||
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
||||||
<string name="customactivityoncrash_error_activity_error_details_share">Share Crash Report</string>
|
<string name="customactivityoncrash_error_activity_error_details_share">Share Crash Report</string>
|
||||||
|
<string name="playlist_created_sucessfully">%s created successfully</string>
|
||||||
|
<string name="playList_already_exits">Playlist already exists</string>
|
||||||
|
<string name="added_song_count_to_playlist">Added %d song(s) to %s</string>
|
||||||
<string name="history_cleared">History cleared</string>
|
<string name="history_cleared">History cleared</string>
|
||||||
<string name="history_undo_button">Undo</string>
|
<string name="history_undo_button">Undo</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue