animate playlist deletion
This commit is contained in:
parent
f01973f1ad
commit
f27a6eb217
15 changed files with 33 additions and 19 deletions
|
@ -174,7 +174,7 @@ class MainActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
|
|||
|
||||
private fun removePlaylist() {
|
||||
if (config.currentPlaylist == DBHelper.ALL_SONGS_ID) {
|
||||
toast(R.string.this_playlist_cannot_be_deleted)
|
||||
toast(R.string.all_songs_cannot_be_deleted)
|
||||
} else {
|
||||
val playlist = dbHelper.getPlaylistWithId(config.currentPlaylist)
|
||||
RemovePlaylistDialog(this, playlist) {
|
||||
|
|
|
@ -87,11 +87,24 @@ class PlaylistsAdapter(activity: SimpleActivity, val playlists: ArrayList<Playli
|
|||
}
|
||||
|
||||
private fun removePlaylists(ids: ArrayList<Int>) {
|
||||
activity.dbHelper.removePlaylists(ids)
|
||||
if (ids.contains(DBHelper.ALL_SONGS_ID)) {
|
||||
activity.toast(R.string.this_playlist_cannot_be_deleted)
|
||||
val playlistsToDelete = ArrayList<Playlist>(selectedPositions.size)
|
||||
|
||||
for (pos in selectedPositions) {
|
||||
if (playlists[pos].id == DBHelper.ALL_SONGS_ID) {
|
||||
activity.toast(R.string.all_songs_cannot_be_deleted)
|
||||
selectedPositions.remove(pos)
|
||||
toggleItemSelection(false, pos)
|
||||
break
|
||||
}
|
||||
}
|
||||
listener?.refreshItems()
|
||||
|
||||
selectedPositions.sortedDescending().forEach {
|
||||
val playlist = playlists[it]
|
||||
playlistsToDelete.add(playlist)
|
||||
}
|
||||
playlists.removeAll(playlistsToDelete)
|
||||
activity.dbHelper.removePlaylists(ids)
|
||||
removeSelectedItems()
|
||||
}
|
||||
|
||||
private fun showRenameDialog() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
android:inputType="textCapSentences"
|
||||
android:maxLength="50"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"/>
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Diese Aktion wird nur alle Dateien der Playlist \"%s\" löschen, nicht die eigentlichen Dateien.</string>
|
||||
<string name="delete_the_files_too">Dateien auch löschen</string>
|
||||
<string name="open_playlist">Playlist öffnen</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Die Ausgangsplaylist kann nicht gelöscht werden</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'Alle Lieder\' Playlist kann nicht gelöscht werden</string>
|
||||
<string name="empty_playlist">Die derzeitige Playlist ist leer</string>
|
||||
<string name="fetching_songs">Rufe Lieder ab…</string>
|
||||
<string name="all_songs">Alle Lieder</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">This will only remove the items from playlist \"%s\", the actual files will not be deleted.</string>
|
||||
<string name="delete_the_files_too">Delete the files too</string>
|
||||
<string name="open_playlist">Open playlist</string>
|
||||
<string name="this_playlist_cannot_be_deleted">The initial playlist cannot be deleted</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Current playlist is empty</string>
|
||||
<string name="fetching_songs">Fetching songs…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
<string name="remove_from_playlist_description">Ez csak az elemeket törli ki a(z) „%s” lejátszólistából, nem magukat a fájlokat.</string>
|
||||
<string name="delete_the_files_too">A fájlok is kerüljenek törlésre</string>
|
||||
<string name="open_playlist">Lejátszólista megnyitása</string>
|
||||
<string name="this_playlist_cannot_be_deleted">A kezdeti lejátszólista nem törölhet</string>
|
||||
<string name="all_songs_cannot_be_deleted">Az \'Összes szám\' lejátszólista nem törölhet</string>
|
||||
<string name="empty_playlist">A jelenlegi lejátszólista üres</string>
|
||||
<string name="fetching_songs">Számok lekérése…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
<string name="all_songs">Összes szám</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="equalizer">Hangszínszabályzó</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">This will only remove the items from playlist \"%s\", the actual files will not be deleted.</string>
|
||||
<string name="delete_the_files_too">Delete the files too</string>
|
||||
<string name="open_playlist">Open playlist</string>
|
||||
<string name="this_playlist_cannot_be_deleted">The initial playlist cannot be deleted</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Current playlist is empty</string>
|
||||
<string name="fetching_songs">Fetching songs…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">This will only remove the items from playlist \"%s\", the actual files will not be deleted.</string>
|
||||
<string name="delete_the_files_too">Delete the files too</string>
|
||||
<string name="open_playlist">Open playlist</string>
|
||||
<string name="this_playlist_cannot_be_deleted">The initial playlist cannot be deleted</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Current playlist is empty</string>
|
||||
<string name="fetching_songs">Fetching songs…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Dit zal alleen items uit afspeellijst \"%s\" verwijderen. Bestanden worden niet verwijderd.</string>
|
||||
<string name="delete_the_files_too">Bestanden ook verwijderen</string>
|
||||
<string name="open_playlist">Afspeellijst openen</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Deze lijst kan niet worden verwijderd</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Huidige afspeellijst is leeg</string>
|
||||
<string name="fetching_songs">Nummers laden…</string>
|
||||
<string name="all_songs">Alle nummers</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">To usunie tylko elementy z playlisty \"%s\", pliki zostaną nienaruszone.</string>
|
||||
<string name="delete_the_files_too">Usuń też pliki</string>
|
||||
<string name="open_playlist">Otwórz playlistę</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Początkowa playlista nie może zostać usunięta</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'Wszystkie utwory\' playlista nie może zostać usunięta</string>
|
||||
<string name="empty_playlist">Obecna playlista jest pusta</string>
|
||||
<string name="fetching_songs">Otrzymywanie utworów…</string>
|
||||
<string name="all_songs">Wszystkie utwory</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Esta ação remove os elementos da lista de reprodução \"%s\" mas não apaga os ficheiros.</string>
|
||||
<string name="delete_the_files_too">Apagar também os ficheiros</string>
|
||||
<string name="open_playlist">Abrir lista de reprodução</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Não pode apagar a lista de reprodução inicial</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">A lista de reprodução está vazia</string>
|
||||
<string name="fetching_songs">A obter músicas…</string>
|
||||
<string name="all_songs">Todas as faixas</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Композиции будут удалены только из плейлиста «%s», сами файлы удалены не будут.</string>
|
||||
<string name="delete_the_files_too">Удалить файлы тоже</string>
|
||||
<string name="open_playlist">Открыть плейлист</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Начальный плейлист не может быть удалён</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Текущий плейлист пуст</string>
|
||||
<string name="fetching_songs">Загрузка композиций…</string>
|
||||
<string name="all_songs">Все композиции</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Toto iba odstráni skladby zo zoznamu skladieb \"%s\", samotné súbory nebudú vymazané.</string>
|
||||
<string name="delete_the_files_too">Odstrániť aj súbory</string>
|
||||
<string name="open_playlist">Otvoriť zoznam skladieb</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Východzí zoznam skladieb nemôže byť vymazaný</string>
|
||||
<string name="all_songs_cannot_be_deleted">Zoznam skladieb \'Všetky skladby\' nemôže byť vymazaný</string>
|
||||
<string name="empty_playlist">Súčasný zoznam skladieb je prázdny</string>
|
||||
<string name="fetching_songs">Pridávajú sa skladby…</string>
|
||||
<string name="all_songs">Všetky skladby</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">Detta tar bara bort objekten från spellistan \"%s\", själva filerna tas inte bort.</string>
|
||||
<string name="delete_the_files_too">Ta även bort filerna</string>
|
||||
<string name="open_playlist">Öppna spellista</string>
|
||||
<string name="this_playlist_cannot_be_deleted">Den förinställda spellistan kan inte tas bort</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Den aktuella spellistan är tom</string>
|
||||
<string name="fetching_songs">Fetching songs…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="remove_from_playlist_description">This will only remove the items from playlist \"%s\", the actual files will not be deleted.</string>
|
||||
<string name="delete_the_files_too">Delete the files too</string>
|
||||
<string name="open_playlist">Open playlist</string>
|
||||
<string name="this_playlist_cannot_be_deleted">This playlist cannot be deleted</string>
|
||||
<string name="all_songs_cannot_be_deleted">\'All songs\' playlist cannot be deleted</string>
|
||||
<string name="empty_playlist">Current playlist is empty</string>
|
||||
<string name="fetching_songs">Fetching songs…</string>
|
||||
<string name="all_songs">All songs</string>
|
||||
|
|
Loading…
Reference in a new issue