fix the zoom level glitch at rotating images by aspect ratio

This commit is contained in:
tibbi 2018-02-20 22:10:49 +01:00
parent 909419371c
commit 50eb1a4565
2 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,7 @@ dependencies {
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
//implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation 'com.github.tibbi:subsampling-scale-image-view:v3.9.0.1-fork'
implementation 'com.github.tibbi:subsampling-scale-image-view:v3.9.0.6-fork'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

View File

@ -31,6 +31,7 @@ import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.GlideRotateTransformation
import com.simplemobiletools.gallery.helpers.MEDIUM
import com.simplemobiletools.gallery.helpers.ROTATE_BY_ASPECT_RATIO
import com.simplemobiletools.gallery.models.Medium
import it.sephiroth.android.library.exif2.ExifInterface
import kotlinx.android.synthetic.main.pager_photo_item.view.*
@ -275,6 +276,7 @@ class PhotoFragment : ViewPagerFragment() {
maxScale = 10f
beVisible()
isQuickScaleEnabled = context.config.oneFingerZoom
setResetScaleOnSizeChange(context.config.screenRotation != ROTATE_BY_ASPECT_RATIO)
setImage(ImageSource.uri(getPathToLoad(medium)))
orientation = if (imageOrientation == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(imageOrientation)
setEagerLoadingEnabled(false)