[Android] Do not show overlay on double tap events
Geoffrey Métais
git at videolan.org
Tue May 16 15:42:57 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 16 14:49:02 2017 +0200| [5c458c00cc28114e4c82b2e774f91f2b6dc2df99] | committer: Geoffrey Métais
Do not show overlay on double tap events
> https://code.videolan.org/videolan/vlc-android/commit/5c458c00cc28114e4c82b2e774f91f2b6dc2df99
---
.../videolan/vlc/gui/video/VideoPlayerActivity.java | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 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 a7a1ef2..5b2b44f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -140,8 +140,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
-import static org.videolan.vlc.R.string.seek;
-
public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.Callback, IVLCVout.OnNewVideoLayoutListener,
IPlaybackSettingsController, PlaybackService.Client.Callback, PlaybackService.Callback,
PlaylistAdapter.IPlayer, OnClickListener, View.OnLongClickListener, ScaleGestureDetector.OnScaleGestureListener {
@@ -223,6 +221,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private static final int RESET_BACK_LOCK = 6;
private static final int CHECK_VIDEO_TRACKS = 7;
private static final int LOADING_ANIMATION = 8;
+ private static final int SHOW_INFO = 9;
+ private static final int HIDE_INFO = 10;
private static final int LOADING_ANIMATION_DELAY = 1000;
@@ -1717,6 +1717,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
case LOADING_ANIMATION:
startLoading();
break;
+ case HIDE_INFO:
+ hideOverlay(true);
+ break;
+ case SHOW_INFO:
+ showOverlay();
+ break;
}
return true;
}
@@ -2615,12 +2621,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
if (mService.isPlaying()) {
pause();
- showOverlayTimeout(OVERLAY_INFINITE);
} else {
play();
- showOverlayTimeout(OVERLAY_TIMEOUT);
}
- mPlayPause.requestFocus();
}
private long getTime() {
@@ -3591,15 +3594,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
@Override
public boolean onSingleTapUp(MotionEvent e) {
- if (mShowing)
- hideOverlay(true);
- else
- showOverlay();
+ mHandler.sendEmptyMessageDelayed(mShowing ? HIDE_INFO : SHOW_INFO, 200);
return true;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
+ mHandler.removeMessages(HIDE_INFO);
+ mHandler.removeMessages(SHOW_INFO);
float range = mCurrentScreenOrientation == Configuration.ORIENTATION_LANDSCAPE ? mSurfaceXDisplayRange : mSurfaceYDisplayRange;
if (mService == null)
return false;
More information about the Android
mailing list