Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
Add menu entry to add playlist URLs for soundcloud, e.g. playlists in…
Browse files Browse the repository at this point in the history
… NowPlaylingPlaylistView. Fixes #125
  • Loading branch information
djselbeck committed May 27, 2018
1 parent 3cdda11 commit 4fc13ee
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -403,15 +403,26 @@ 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();
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;
}
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;
Expand Down Expand Up @@ -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());
Expand Down
20 changes: 15 additions & 5 deletions app/src/main/res/menu/popup_menu_nowplaying.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,21 @@
android:title="@string/action_clear_playlist"
app:showAsAction="never" />

<item
android:id="@+id/action_add_url"
android:orderInCategory="4"
android:title="@string/action_add_url"
app:showAsAction="never" />
<item android:id="@+id/group_playlist_add_actions"
android:title="@string/action_add_group">
<menu>
<item
android:id="@+id/action_add_url"
android:orderInCategory="4"
android:title="@string/action_add_url"
app:showAsAction="never" />
<item
android:id="@+id/action_add_url_playlist"
android:orderInCategory="5"
android:title="@string/action_add_url_playlist"
app:showAsAction="never" />
</menu>
</item>
<item
android:id="@+id/action_jump_to_current"
android:orderInCategory="5"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,6 @@
<string name="preference_use_artist_sort_text">Verwenden des ArtistSort (oder AlbumArtistSort) Tags, falls der Server diesen anbietet.</string>
<string name="preference_npv_show_playlist_title">Starte mit Wiedergabeliste</string>
<string name="preference_npv_show_playlist_text">Zeige die Wiedergabeliste wenn während der Wiedergabe M.A.L.P. über ein Widget oder Benachrichtigung gestartet wird</string>
<string name="action_add_group">Hinzufügen</string>
<string name="action_add_url_playlist">Playlist-URL hinzufügen</string>
</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@
<string name="action_remove_track">Remove track</string>
<string name="action_remove_album">Remove album</string>

<string name="action_add_url">Add URL</string>
<string name="action_add_group">Add</string>
<string name="action_add_url">Add file URL</string>
<string name="action_add_url_playlist">Add playlist URL</string>
<string name="action_show_albums_from_here">Show albums in this directory</string>
<string name="action_update_database_here">Update database here</string>

Expand Down

0 comments on commit 4fc13ee

Please sign in to comment.