[Android] AudioPlayer: implements Play as Audio off button

Thomas Guillem git at videolan.org
Mon Jul 6 17:27:55 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul  6 17:27:25 2015 +0200| [91840405a78cabe239329e4b09338a755546176d] | committer: Thomas Guillem

AudioPlayer: implements Play as Audio off button

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=91840405a78cabe239329e4b09338a755546176d
---

 .../src/org/videolan/vlc/gui/audio/AudioPlayer.java        |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index aae3065..372f9f1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -78,6 +78,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
     private TextView mTime;
     private TextView mHeaderTime;
     private TextView mLength;
+    private ImageButton mResumeToVideo;
     private ImageButton mPlayPause;
     private ImageButton mHeaderPlayPause;
     private ImageButton mNext;
@@ -128,6 +129,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
         mTime = (TextView) v.findViewById(R.id.time);
         mHeaderTime = (TextView) v.findViewById(R.id.header_time);
         mLength = (TextView) v.findViewById(R.id.length);
+        mResumeToVideo = (ImageButton) v.findViewById(R.id.playlist_playasaudio_off);
         mPlayPause = (ImageButton) v.findViewById(R.id.play_pause);
         mHeaderPlayPause = (ImageButton) v.findViewById(R.id.header_play_pause);
         mNext = (ImageButton) v.findViewById(R.id.next);
@@ -160,6 +162,15 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
                 onTimeLabelClick(v);
             }
         });
+        mResumeToVideo.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mService != null) {
+                    mService.setVideoEnabled(true, false);
+                    mService.handleVout();
+                }
+            }
+        });
         mPlayPause.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -330,6 +341,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
         mCoverMediaSwitcher.updateMedia(mService);
 
         FragmentActivity act = getActivity();
+        mResumeToVideo.setVisibility(mService.getVideoTracksCount() > 0 ? View.VISIBLE : View.GONE);
 
         if (mService.isPlaying()) {
             mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));



More information about the Android mailing list