Confirm add to playlist #1283
This commit is contained in:
Prathamesh More 2022-03-11 08:32:53 +05:30 committed by GitHub
commit 7f3b2b3d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 9 deletions

View file

@ -387,21 +387,36 @@ class LibraryViewModel(
it.toSongEntity(playListId = playlist.playListId)
})
}
}
withContext(Main) {
when {
playlists.isEmpty() -> {
Toast.makeText(
App.getContext(),
"Playlist already exists",
App.getContext()
.getString(R.string.playlist_created_sucessfully, playlistName),
Toast.LENGTH_SHORT
).show()
if (songs.isNotEmpty()) {
}
checkPlaylistExists(playlistName).isNotEmpty() -> {
Toast.makeText(
App.getContext(),
"Adding songs to $playlistName",
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
).show()
}
}
}
}
}

View file

@ -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="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="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_undo_button">Undo</string>
</resources>