[Android] VideoPlayer: seek vertical movement on both side + fix display text

Sébastien Toque git at videolan.org
Sun Mar 6 14:14:38 CET 2016


vlc-android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun Mar  6 14:13:27 2016 +0100| [fd0a27f477ba2735e4280eea08c9012ad26bb15d] | committer: Sébastien Toque

VideoPlayer: seek vertical movement on both side + fix display text

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java        | 7 ++++---
 1 file changed, 4 insertions(+), 3 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 f22f5e3..7900d15 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1816,7 +1816,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         // coef is the gradient's move to determine a neutral zone
         float coef = Math.abs (y_changed / x_changed);
         float xgesturesize = ((x_changed / screen.xdpi) * 2.54f);
-        float delta_y = Math.max(1f, ((mInitTouchY - event.getRawY()) / screen.xdpi + 0.5f) * 2f);
+        float delta_y = Math.max(1f, (Math.abs(mInitTouchY - event.getRawY()) / screen.xdpi + 0.5f) * 2f);
 
         /* Offset for Mouse Events */
         int[] offset = new int[2];
@@ -1914,10 +1914,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         if (length > 0)
             //Show the jump's size
-            showInfo(String.format("%s%s (%s) x%d",
+            showInfo(String.format("%s%s (%s)%s",
                     jump >= 0 ? "+" : "",
                     Strings.millisToString(jump),
-                    Strings.millisToString(time + jump), coef), 1000);
+                    Strings.millisToString(time + jump),
+                    coef > 1 ? String.format(" x%.1g", 1.0/coef) : ""), 1000);
         else
             showInfo(R.string.unseekable_stream, 1000);
     }



More information about the Android mailing list