[Android] Audio player: remove the stop button and perform stop on long click of the play-pause button

Adrien Maglo git at videolan.org
Wed Jan 29 16:47:47 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jan 29 16:47:40 2014 +0100| [ee1ef229346a5b4b006e2cb5f4266b6ed08e902a] | committer: Adrien Maglo

Audio player: remove the stop button and perform stop on long click of the play-pause button

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

 vlc-android/res/layout/audio_player.xml                   |   12 ------------
 .../src/org/videolan/vlc/gui/audio/AudioPlayer.java       |   13 ++++++-------
 2 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/vlc-android/res/layout/audio_player.xml b/vlc-android/res/layout/audio_player.xml
index 7094139..a7c0a78 100644
--- a/vlc-android/res/layout/audio_player.xml
+++ b/vlc-android/res/layout/audio_player.xml
@@ -188,18 +188,6 @@
             android:src="@drawable/ic_pause" />
 
         <ImageButton
-            android:id="@+id/stop"
-            android:layout_width="50dp"
-            android:layout_height="50dp"
-            android:layout_marginLeft="10dip"
-            android:layout_marginRight="10dip"
-            android:background="#00000000"
-            android:contentDescription="@string/stop"
-            android:focusable="true"
-            android:scaleType="fitXY"
-            android:src="@drawable/ic_stop" />
-
-        <ImageButton
             android:id="@+id/next"
             android:layout_width="50dp"
             android:layout_height="50dp"
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 b922a78..6a0588b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -74,7 +74,6 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
     private TextView mLength;
     private ImageButton mPlayPause;
     private ImageButton mHeaderPlayPause;
-    private ImageButton mStop;
     private ImageButton mNext;
     private ImageButton mPrevious;
     private ImageButton mShuffle;
@@ -121,7 +120,6 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
         mLength = (TextView) v.findViewById(R.id.length);
         mPlayPause = (ImageButton) v.findViewById(R.id.play_pause);
         mHeaderPlayPause = (ImageButton) v.findViewById(R.id.header_play_pause);
-        mStop = (ImageButton) v.findViewById(R.id.stop);
         mNext = (ImageButton) v.findViewById(R.id.next);
         mPrevious = (ImageButton) v.findViewById(R.id.previous);
         mShuffle = (ImageButton) v.findViewById(R.id.shuffle);
@@ -156,16 +154,17 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
                 onPlayPauseClick(v);
             }
         });
-        mHeaderPlayPause.setOnClickListener(new View.OnClickListener() {
+        mPlayPause.setOnLongClickListener(new View.OnLongClickListener() {
             @Override
-            public void onClick(View v) {
-                onPlayPauseClick(v);
+            public boolean onLongClick(View v) {
+                onStopClick(v);
+                return true;
             }
         });
-        mStop.setOnClickListener(new View.OnClickListener() {
+        mHeaderPlayPause.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                onStopClick(v);
+                onPlayPauseClick(v);
             }
         });
         mNext.setOnClickListener(new View.OnClickListener() {



More information about the Android mailing list