[Android] AudioPlayer: use long seek for next/previous

Edward Wang git at videolan.org
Fri May 30 05:50:41 CEST 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu May 29 23:42:12 2014 -0400| [1fbc6bd483aec8c3cc8d6e9d02528f5171a06094] | committer: Edward Wang

AudioPlayer: use long seek for next/previous

Close #10776

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

 .../org/videolan/vlc/gui/audio/AudioPlayer.java    |   25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)

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 734422d..2228413 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -42,6 +42,7 @@ import org.videolan.vlc.widget.AudioMediaSwitcher.AudioMediaSwitcherListener;
 import android.media.AudioManager;
 import android.os.Bundle;
 import android.os.Handler;
+import android.preference.PreferenceManager;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentActivity;
 import android.util.Log;
@@ -177,18 +178,18 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
                 return true;
             }
         });
-        mNext.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                onNextClick(v);
-            }
-        });
-        mPrevious.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                onPreviousClick(v);
-            }
-        });
+        boolean blackTheme = PreferenceManager.getDefaultSharedPreferences(
+                getActivity()).getBoolean("enable_black_theme", false);
+        mNext.setOnTouchListener(new LongSeekListener(true,
+                blackTheme ? R.drawable.ic_next_normal_w
+                        : R.drawable.ic_next_normal,
+                blackTheme ? R.drawable.ic_next_pressed_w
+                        : R.drawable.ic_next_pressed));
+        mPrevious.setOnTouchListener(new LongSeekListener(false,
+                blackTheme ? R.drawable.ic_previous_normal_w
+                        : R.drawable.ic_previous_normal,
+                blackTheme ? R.drawable.ic_previous_pressed_w
+                        : R.drawable.ic_previous_pressed));
         mShuffle.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {



More information about the Android mailing list