do not trigger click event at swiping at videos

This commit is contained in:
tibbi 2017-09-30 20:49:08 +02:00
parent 3d674c65ba
commit 50a693d5e6

View file

@ -165,7 +165,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mLastTouchY = event.y mLastTouchY = event.y
} }
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
mView.video_holder.performClick() mView.video_holder.performClick()
} }
} }
@ -201,7 +203,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mLastTouchY = event.y mLastTouchY = event.y
} }
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
mView.video_holder.performClick() mView.video_holder.performClick()
} }
mTouchDownBrightness = mTempBrightness mTouchDownBrightness = mTempBrightness