diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index 0eec36b1b..b5fa60610 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -349,6 +349,11 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare return view; } + /** + * Set the title of the stream + * @param title the title of the stream + * @return this builder for chaining + */ NoteBuilder setTitle(String title) { setContentTitle(title); getContentView().setTextViewText(R.id.notificationSongName, title); @@ -358,6 +363,11 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare return this; } + /** + * Set the artist of the stream + * @param artist the artist of the stream + * @return this builder for chaining + */ NoteBuilder setArtist(String artist) { setSubText(artist); getContentView().setTextViewText(R.id.notificationArtist, artist); @@ -367,16 +377,15 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare @Override public android.support.v4.app.NotificationCompat.Builder setProgress(int max, int progress, boolean indeterminate) { - // TODO: implement - return super.setProgress(max, progress, indeterminate); - } - - @Override - public Notification build() { - - return super.build(); + super.setProgress(max, progress, indeterminate); + getBigContentView().setProgressBar(R.id.playbackProgress, max, progress, indeterminate); + return this; } + /** + * Set the isPlaying state + * @param isPlaying the is playing state + */ public void setIsPlaying(boolean isPlaying) { RemoteViews views = getContentView(), bigViews = getBigContentView(); int imageSrc; diff --git a/app/src/main/res/layout/player_notification_expanded.xml b/app/src/main/res/layout/player_notification_expanded.xml index 5a8b3a9d3..8a0da2af3 100644 --- a/app/src/main/res/layout/player_notification_expanded.xml +++ b/app/src/main/res/layout/player_notification_expanded.xml @@ -40,6 +40,12 @@ android:ellipsize="marquee" android:singleLine="true" android:text="artist" /> + +