[Android] Rewind/forward buttons seek for 10 seconds

Geoffrey Métais git at videolan.org
Tue Jan 12 13:49:58 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 12 13:35:10 2016 +0100| [1eed09e7d7da42434942b18ad9d91a669336bc44] | committer: Geoffrey Métais

Rewind/forward buttons seek for 10 seconds

> https://code.videolan.org/videolan/vlc-android/commit/1eed09e7d7da42434942b18ad9d91a669336bc44
---

 .../vlc/gui/video/VideoPlayerActivity.java         | 29 ++++++++--------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index c21cc5f..f0fbae1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2133,6 +2133,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             case R.id.playlist_toggle:
                 togglePlaylist();
                 break;
+            case R.id.player_overlay_forward:
+                seekDelta(10000);
+                break;
+            case R.id.player_overlay_rewind:
+                seekDelta(-10000);
+                break;
         }
     }
 
@@ -2339,27 +2345,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mForward = (ImageView) findViewById(R.id.player_overlay_forward);
         mRewind.setVisibility(View.VISIBLE);
         mForward.setVisibility(View.VISIBLE);
-        mRewind.setOnClickListener(mRewindListener);
-        mForward.setOnClickListener(mForwardListener);
-        mRewind.setOnTouchListener(new OnRepeatListener(mRewindListener));
-        mForward.setOnTouchListener(new OnRepeatListener(mForwardListener));
+        mRewind.setOnClickListener(this);
+        mForward.setOnClickListener(this);
+        mRewind.setOnTouchListener(new OnRepeatListener(this));
+        mForward.setOnTouchListener(new OnRepeatListener(this));
     }
 
-
-    private final OnClickListener mRewindListener = new OnClickListener() {
-        @Override
-        public void onClick(View v) {
-            seekDelta(-30000);
-        }
-    };
-
-    private final OnClickListener mForwardListener = new OnClickListener() {
-        @Override
-        public void onClick(View v) {
-            seekDelta(30000);
-        }
-    };
-
     /**
      *
      */



More information about the Android mailing list