ViewImageFragment: upgrade BigImageView to 1.6.6, enable swiping for all kinds of embedded views
This commit is contained in:
parent
483b847120
commit
fe0e68ba5c
|
@ -178,9 +178,9 @@ dependencies {
|
||||||
|
|
||||||
implementation "com.github.connyduck:sparkbutton:4.0.0"
|
implementation "com.github.connyduck:sparkbutton:4.0.0"
|
||||||
|
|
||||||
implementation 'com.github.piasy:BigImageViewer:1.6.5'
|
implementation 'com.github.piasy:BigImageViewer:1.6.6'
|
||||||
implementation 'com.github.piasy:GlideImageLoader:1.6.5'
|
implementation 'com.github.piasy:GlideImageLoader:1.6.6'
|
||||||
implementation 'com.github.piasy:GlideImageViewFactory:1.6.5'
|
implementation 'com.github.piasy:GlideImageViewFactory:1.6.6'
|
||||||
|
|
||||||
implementation "com.mikepenz:materialdrawer:$materialdrawerVersion"
|
implementation "com.mikepenz:materialdrawer:$materialdrawerVersion"
|
||||||
implementation "com.mikepenz:materialdrawer-iconics:$materialdrawerVersion"
|
implementation "com.mikepenz:materialdrawer-iconics:$materialdrawerVersion"
|
||||||
|
|
|
@ -118,7 +118,8 @@ class ViewImageFragment : ViewMediaFragment() {
|
||||||
swipeStartedWithOneFinger = false
|
swipeStartedWithOneFinger = false
|
||||||
}
|
}
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
if(swipeStartedWithOneFinger && photoView.ssiv.scale <= photoView.ssiv.minScale) {
|
if(swipeStartedWithOneFinger &&
|
||||||
|
(photoView.ssiv == null || photoView.ssiv.scale <= photoView.ssiv.minScale)) {
|
||||||
val diff = event.rawY - lastY
|
val diff = event.rawY - lastY
|
||||||
// This code is to prevent transformations during page scrolling
|
// This code is to prevent transformations during page scrolling
|
||||||
// If we are already translating or we reached the threshold, then transform.
|
// If we are already translating or we reached the threshold, then transform.
|
||||||
|
@ -149,7 +150,6 @@ class ViewImageFragment : ViewMediaFragment() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// photoView.setOnTouchListener(this)
|
|
||||||
photoView.setImageLoaderCallback(imageLoaderCallback)
|
photoView.setImageLoaderCallback(imageLoaderCallback)
|
||||||
photoView.setImageViewFactory(GlideImageViewFactory())
|
photoView.setImageViewFactory(GlideImageViewFactory())
|
||||||
|
|
||||||
|
@ -266,10 +266,8 @@ class ViewImageFragment : ViewMediaFragment() {
|
||||||
override fun onSuccess(image: File?) {
|
override fun onSuccess(image: File?) {
|
||||||
if(!showingPreview) {
|
if(!showingPreview) {
|
||||||
progressBar?.hide()
|
progressBar?.hide()
|
||||||
photoView.ssiv?.let {
|
photoView.ssiv?.orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF
|
||||||
it.orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF
|
photoView.mainView?.setOnTouchListener(imageOnTouchListener)
|
||||||
it.setOnTouchListener(imageOnTouchListener)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue