mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
properly handle image rotation with picasso
This commit is contained in:
parent
7a408e050d
commit
63d8462ce0
1 changed files with 3 additions and 10 deletions
|
@ -335,7 +335,6 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
}
|
||||
|
||||
private fun loadSVG() {
|
||||
setupGestureView()
|
||||
Glide.with(context!!)
|
||||
.`as`(PictureDrawable::class.java)
|
||||
.listener(SvgSoftwareLayerSetter())
|
||||
|
@ -356,9 +355,10 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
|
||||
if (degrees != 0) {
|
||||
picasso.rotate(degrees.toFloat())
|
||||
} else {
|
||||
degreesForRotation(mImageOrientation).toFloat()
|
||||
}
|
||||
|
||||
setupGestureView()
|
||||
picasso.into(mView.gestures_view, object : Callback {
|
||||
override fun onSuccess() {
|
||||
mView.gestures_view.controller.settings.isZoomEnabled = degrees != 0 || context?.config?.allowZoomingImages == false
|
||||
|
@ -377,13 +377,6 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupGestureView() {
|
||||
mView.gestures_view.controller.apply {
|
||||
settings.maxZoom = 3f
|
||||
settings.overzoomFactor = 1.2f
|
||||
}
|
||||
}
|
||||
|
||||
private fun tryLoadingWithGlide() {
|
||||
var targetWidth = if (mScreenWidth == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else mScreenWidth
|
||||
var targetHeight = if (mScreenHeight == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else mScreenHeight
|
||||
|
@ -456,9 +449,9 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
isQuickScaleEnabled = config.oneFingerZoom
|
||||
isOneToOneZoomEnabled = config.allowOneToOneZoom
|
||||
setResetScaleOnSizeChange(false)
|
||||
setImage(ImageSource.uri(path))
|
||||
setOrientation(rotation)
|
||||
setEagerLoadingEnabled(false)
|
||||
setImage(ImageSource.uri(path))
|
||||
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
||||
override fun onImageLoaded() {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue