<div dir="ltr"><div dir="ltr">LGTM</div>
<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 6, 2014 at 11:26 AM, Thomas Guillem <span dir="ltr"><<a href="mailto:thomas@gllm.fr" target="_blank">thomas@gllm.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Don't hide ui on gesture or while seeking.<br>
---<br>
 .../vlc/gui/video/VideoPlayerActivity.java         | 44 ++++++++++++----------<br>
 1 file changed, 25 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java<br>
index c08a95e..6172d43 100644<br>
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java<br>
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java<br>
@@ -1411,29 +1411,27 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
                 if (mEnableBrightnessGesture && (int)mTouchX < (screen.widthPixels / 2)){<br>
                     doBrightnessTouch(y_changed);<br>
                 }<br>
-                // Extend the overlay for a little while, so that it doesn't<br>
-                // disappear on the user if more adjustment is needed. This<br>
-                // is because on devices with soft navigation (e.g. Galaxy<br>
-                // Nexus), gestures can't be made without activating the UI.<br>
-                if(AndroidDevices.hasNavBar())<br>
-                    showOverlay();<br>
             } else {<br>
                 // Seek (Right or Left move)<br>
                 doSeekTouch(coef, xgesturesize, false);<br>
             }<br>
+            if (mTouchAction != TOUCH_NONE && mOverlayTimeout != OVERLAY_INFINITE)<br>
+                showOverlayTimeout(OVERLAY_INFINITE);<br>
             break;<br>
<br>
         case MotionEvent.ACTION_UP:<br>
             // Mouse events for the core<br>
             LibVLC.sendMouseEvent(MotionEvent.ACTION_UP, 0, xTouch, yTouch);<br>
<br>
-            // Audio or Brightness<br>
-            if ( mTouchAction == TOUCH_NONE) {<br>
+            if (mTouchAction == TOUCH_NONE) {<br>
                 if (!mShowing) {<br>
                     showOverlay();<br>
                 } else {<br>
                     hideOverlay(true);<br>
                 }<br>
+            } else {<br>
+                // We were in gesture mode, re-init the overlay timeout<br>
+                showOverlay(true);<br>
             }<br>
             // Seek<br>
             doSeekTouch(coef, xgesturesize, true);<br>
@@ -1451,9 +1449,6 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
             return;<br>
         mTouchAction = TOUCH_SEEK;<br>
<br>
-        // Always show seekbar when searching<br>
-        if (!mShowing) showOverlay();<br>
-<br>
         long length = mLibVLC.getLength();<br>
         long time = mLibVLC.getTime();<br>
<br>
@@ -1565,13 +1560,13 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
         @Override<br>
         public void onStartTrackingTouch(SeekBar seekBar) {<br>
             mDragging = true;<br>
-            showOverlay(OVERLAY_INFINITE);<br>
+            showOverlayTimeout(OVERLAY_INFINITE);<br>
         }<br>
<br>
         @Override<br>
         public void onStopTrackingTouch(SeekBar seekBar) {<br>
             mDragging = false;<br>
-            showOverlay();<br>
+            showOverlay(true);<br>
             hideInfo();<br>
         }<br>
<br>
@@ -1714,12 +1709,12 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
     };<br>
<br>
     private final void doPlayPause() {<br>
-        if (mLibVLC.isPlaying()){<br>
+        if (mLibVLC.isPlaying()) {<br>
             pause();<br>
-            showOverlay(OVERLAY_INFINITE);<br>
+            showOverlayTimeout(OVERLAY_INFINITE);<br>
         } else {<br>
             play();<br>
-            showOverlay(OVERLAY_TIMEOUT);<br>
+            showOverlayTimeout(OVERLAY_TIMEOUT);<br>
         }<br>
     }<br>
<br>
@@ -1870,10 +1865,20 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
     };<br>
<br>
     /**<br>
-     * show overlay the the default timeout<br>
+     * show overlay<br>
+     * @param forceCheck: adjust the timeout in function of playing state<br>
+     */<br>
+    private void showOverlay(boolean forceCheck) {<br>
+        if (forceCheck)<br>
+            mOverlayTimeout = 0;<br>
+        showOverlayTimeout(0);<br>
+    }<br>
+<br>
+    /**<br>
+     * show overlay with the previous timeout value<br>
      */<br>
     private void showOverlay() {<br>
-        showOverlay(0);<br>
+        showOverlay(false);<br>
     }<br>
<br>
     @TargetApi(Build.VERSION_CODES.HONEYCOMB)<br>
@@ -1887,7 +1892,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
     /**<br>
      * show overlay<br>
      */<br>
-    private void showOverlay(int timeout) {<br>
+    private void showOverlayTimeout(int timeout) {<br>
         if (timeout != 0)<br>
             mOverlayTimeout = timeout;<br>
         if (mOverlayTimeout == 0)<br>
@@ -1922,6 +1927,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {<br>
      */<br>
     private void hideOverlay(boolean fromUser) {<br>
         if (mShowing) {<br>
+            mHandler.removeMessages(FADE_OUT);<br>
             mHandler.removeMessages(SHOW_PROGRESS);<br>
             Log.i(TAG, "remove View!");<br>
             if (mOverlayTips != null) mOverlayTips.setVisibility(View.INVISIBLE);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.1<br>
<br>
_______________________________________________<br>
Android mailing list<br>
<a href="mailto:Android@videolan.org">Android@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/android" target="_blank">https://mailman.videolan.org/listinfo/android</a><br>
</font></span></blockquote></div><br></div>