From 4fc13ee1d2c376f65549a1b1ffad8afdfe1e8303 Mon Sep 17 00:00:00 2001 From: Hendrik Borghorst Date: Sun, 27 May 2018 11:34:35 +0200 Subject: [PATCH] Add menu entry to add playlist URLs for soundcloud, e.g. playlists in NowPlaylingPlaylistView. Fixes #125 --- .../application/views/NowPlayingView.java | 19 ++++++++++++++---- .../main/res/menu/popup_menu_nowplaying.xml | 20 ++++++++++++++----- app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 4 +++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/gateshipone/malp/application/views/NowPlayingView.java b/app/src/main/java/org/gateshipone/malp/application/views/NowPlayingView.java index be00c55c..72b2c543 100644 --- a/app/src/main/java/org/gateshipone/malp/application/views/NowPlayingView.java +++ b/app/src/main/java/org/gateshipone/malp/application/views/NowPlayingView.java @@ -361,7 +361,7 @@ public boolean onMenuItemClick(MenuItem item) { }); shuffleListBuilder.create().show(); } - break; + break; case R.id.action_save_playlist: OnSaveDialogListener plDialogCallback = new OnSaveDialogListener() { @Override @@ -403,7 +403,7 @@ public void onCreateNewObject() { choosePlaylistDialog.setArguments(args); choosePlaylistDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "ChoosePlaylistDialog"); break; - case R.id.action_add_url: + case R.id.action_add_url: { TextDialog addURLDialog = new TextDialog(); addURLDialog.setCallback(MPDQueryHandler::addPath); Bundle textDialogArgs = new Bundle(); @@ -411,7 +411,18 @@ public void onCreateNewObject() { textDialogArgs.putString(TextDialog.EXTRA_DIALOG_TITLE, getResources().getString(R.string.action_add_url)); addURLDialog.setArguments(textDialogArgs); addURLDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "AddURLDialog"); - break; + } + break; + case R.id.action_add_url_playlist: { + TextDialog addURLDialog = new TextDialog(); + addURLDialog.setCallback(MPDQueryHandler::loadPlaylist); + Bundle textDialogArgs = new Bundle(); + textDialogArgs.putString(TextDialog.EXTRA_DIALOG_TEXT, "http://..."); + textDialogArgs.putString(TextDialog.EXTRA_DIALOG_TITLE, getResources().getString(R.string.action_add_url)); + addURLDialog.setArguments(textDialogArgs); + addURLDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "AddURLDialog"); + } + break; case R.id.action_jump_to_current: mPlaylistView.jumpToCurrentSong(); break; @@ -1306,7 +1317,7 @@ private void updateMPDCurrentTrack(MPDTrack track) { mCoverLoader.getImage(track, true, mCoverImage.getWidth(), mCoverImage.getHeight()); } - if (mShowArtistImage && (null == mLastTrack || !track.getTrackArtist().equals(mLastTrack.getTrackArtist()) || !track.getTrackArtistMBID().equals(mLastTrack.getTrackAlbumArtistMBID()) )) { + if (mShowArtistImage && (null == mLastTrack || !track.getTrackArtist().equals(mLastTrack.getTrackArtist()) || !track.getTrackArtistMBID().equals(mLastTrack.getTrackAlbumArtistMBID()))) { mCoverImage.clearArtistImage(); mCoverLoader.getArtistImage(track, true, mCoverImage.getWidth(), mCoverImage.getHeight()); diff --git a/app/src/main/res/menu/popup_menu_nowplaying.xml b/app/src/main/res/menu/popup_menu_nowplaying.xml index 8896bf59..109aa9de 100644 --- a/app/src/main/res/menu/popup_menu_nowplaying.xml +++ b/app/src/main/res/menu/popup_menu_nowplaying.xml @@ -56,11 +56,21 @@ android:title="@string/action_clear_playlist" app:showAsAction="never" /> - + + + + + + Verwenden des ArtistSort (oder AlbumArtistSort) Tags, falls der Server diesen anbietet. Starte mit Wiedergabeliste Zeige die Wiedergabeliste wenn während der Wiedergabe M.A.L.P. über ein Widget oder Benachrichtigung gestartet wird + Hinzufügen + Playlist-URL hinzufügen diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2aeba905..1751d4af 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -83,7 +83,9 @@ Remove track Remove album - Add URL + Add + Add file URL + Add playlist URL Show albums in this directory Update database here