Commit 04533842 authored by Hamza Parnica's avatar Hamza Parnica Committed by Geoffrey Métais

Filter accidental touch events in video player

parent 61ad7bd0
...@@ -298,6 +298,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -298,6 +298,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private static final int TOUCH_BRIGHTNESS = 2; private static final int TOUCH_BRIGHTNESS = 2;
private static final int TOUCH_MOVE = 3; private static final int TOUCH_MOVE = 3;
private static final int TOUCH_SEEK = 4; private static final int TOUCH_SEEK = 4;
private static final int TOUCH_IGNORE = 5;
private int mTouchAction = TOUCH_NONE; private int mTouchAction = TOUCH_NONE;
private int mSurfaceYDisplayRange, mSurfaceXDisplayRange; private int mSurfaceYDisplayRange, mSurfaceXDisplayRange;
private float mFov; private float mFov;
...@@ -2044,6 +2045,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -2044,6 +2045,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
endPlaybackSetting(); endPlaybackSetting();
return true; return true;
} else if (mPlaylist.getVisibility() == View.VISIBLE) { } else if (mPlaylist.getVisibility() == View.VISIBLE) {
mTouchAction = TOUCH_IGNORE;
togglePlaylist(); togglePlaylist();
return true; return true;
} }
...@@ -2093,6 +2095,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -2093,6 +2095,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
sendMouseEvent(MotionEvent.ACTION_DOWN, xTouch, yTouch); sendMouseEvent(MotionEvent.ACTION_DOWN, xTouch, yTouch);
break; break;
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE:
if (mTouchAction == TOUCH_IGNORE) break;
// Mouse events for the core // Mouse events for the core
sendMouseEvent(MotionEvent.ACTION_MOVE, xTouch, yTouch); sendMouseEvent(MotionEvent.ACTION_MOVE, xTouch, yTouch);
...@@ -2119,6 +2123,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -2119,6 +2123,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
} }
break; break;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
if (mTouchAction == TOUCH_IGNORE) mTouchAction = TOUCH_NONE;
// Mouse events for the core // Mouse events for the core
sendMouseEvent(MotionEvent.ACTION_UP, xTouch, yTouch); sendMouseEvent(MotionEvent.ACTION_UP, xTouch, yTouch);
// Seek // Seek
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment