disable Down gesture if the video or gif are zoomed in

This commit is contained in:
tibbi 2019-01-29 20:29:29 +01:00
parent 4db56dce44
commit 8ae759ac89
4 changed files with 11 additions and 5 deletions

View File

@ -61,7 +61,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.7.3' implementation 'com.simplemobiletools:commons:5.7.5'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'
@ -74,7 +74,7 @@ dependencies {
implementation 'info.androidhive:imagefilters:1.0.7' implementation 'info.androidhive:imagefilters:1.0.7'
implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.caverock:androidsvg-aar:1.3' implementation 'com.caverock:androidsvg-aar:1.3'
implementation 'com.github.tibbi:gestureviews:241d14fb68' implementation 'com.github.tibbi:gestureviews:985ba285fb'
implementation 'com.github.tibbi:subsampling-scale-image-view:3ccd2f9c2b' implementation 'com.github.tibbi:subsampling-scale-image-view:3ccd2f9c2b'
kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work

View File

@ -519,7 +519,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
val diffY = mTouchDownY - event.y val diffY = mTouchDownY - event.y
val downGestureDuration = System.currentTimeMillis() - mTouchDownTime val downGestureDuration = System.currentTimeMillis() - mTouchDownTime
if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION) { if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold &&
downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION &&
video_surface_frame.controller.state.zoom == 1f) {
supportFinishAfterTransition() supportFinishAfterTransition()
} }

View File

@ -110,7 +110,9 @@ class PhotoFragment : ViewPagerFragment() {
if (context.config.allowDownGesture) { if (context.config.allowDownGesture) {
gif_view.setOnTouchListener { v, event -> gif_view.setOnTouchListener { v, event ->
if (gif_view_frame.controller.state.zoom == 1f) {
handleEvent(event) handleEvent(event)
}
false false
} }

View File

@ -116,7 +116,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
} }
video_surface_frame.setOnTouchListener { view, event -> video_surface_frame.setOnTouchListener { view, event ->
if (video_surface_frame.controller.state.zoom == 1f) {
handleEvent(event) handleEvent(event)
}
false false
} }
} }