[Android] Properly update progress in UI on seek

Geoffrey Métais git at videolan.org
Wed May 31 09:43:24 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May 31 09:41:54 2017 +0200| [329ad39723e084e39fb52964fb2ea47b6345ff7d] | committer: Geoffrey Métais

Properly update progress in UI on seek

Close #263

> https://code.videolan.org/videolan/vlc-android/commit/329ad39723e084e39fb52964fb2ea47b6345ff7d
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 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 99312f840..56f7cb1f1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2678,8 +2678,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mForcedTime = position;
         mLastTime = mService.getTime();
         mService.seek(position, length);
-        if (mSeekbar != null)
-            mSeekbar.setProgress((int) position);
+        setOverlayProgress((int) position, (int) length);
     }
 
     private void seekDelta(int delta) {
@@ -2977,7 +2976,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         }
         int time = (int) getTime();
         int length = (int) mService.getLength();
+        return setOverlayProgress(time, length);
+    }
 
+    private int setOverlayProgress(int time, int length) {
         // Update all view elements
         if (mSeekbar != null) {
             mSeekbar.setMax(length);



More information about the Android mailing list