[Android] PlaybackService: hide notification prev/next buttons if there is no prev/ next medias
Thomas Guillem
git at videolan.org
Mon Jul 6 15:03:39 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul 6 15:02:42 2015 +0200| [05d22ce18c5d7e677760e672ccbb14f150fddc1c] | committer: Thomas Guillem
PlaybackService: hide notification prev/next buttons if there is no prev/next medias
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=05d22ce18c5d7e677760e672ccbb14f150fddc1c
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 6015ce0..00c40ea 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -852,6 +852,7 @@ public class PlaybackService extends Service {
view.setImageViewResource(R.id.play_pause, mMediaPlayer.isPlaying() ? R.drawable.ic_pause_w : R.drawable.ic_play_w);
view.setOnClickPendingIntent(R.id.play_pause, piPlay);
view.setOnClickPendingIntent(R.id.forward, piForward);
+ view.setViewVisibility(R.id.forward, hasNext() ? View.VISIBLE : View.INVISIBLE);
view.setOnClickPendingIntent(R.id.stop, piStop);
view.setOnClickPendingIntent(R.id.content, pendingIntent);
@@ -862,8 +863,10 @@ public class PlaybackService extends Service {
view_expanded.setTextViewText(R.id.album, album);
view_expanded.setImageViewResource(R.id.play_pause, mMediaPlayer.isPlaying() ? R.drawable.ic_pause_w : R.drawable.ic_play_w);
view_expanded.setOnClickPendingIntent(R.id.backward, piBackward);
+ view_expanded.setViewVisibility(R.id.backward, hasPrevious() ? View.VISIBLE : View.INVISIBLE);
view_expanded.setOnClickPendingIntent(R.id.play_pause, piPlay);
view_expanded.setOnClickPendingIntent(R.id.forward, piForward);
+ view_expanded.setViewVisibility(R.id.forward, hasNext() ? View.VISIBLE : View.INVISIBLE);
view_expanded.setOnClickPendingIntent(R.id.stop, piStop);
view_expanded.setOnClickPendingIntent(R.id.content, pendingIntent);
More information about the Android
mailing list