allow loading subsampling view even with some rotation set

This commit is contained in:
tibbi 2019-02-06 19:36:50 +01:00
parent e4ac69004d
commit c1af0bda75
2 changed files with 5 additions and 6 deletions

View file

@ -75,7 +75,7 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.caverock:androidsvg-aar:1.3'
implementation 'com.github.tibbi:gestureviews:985ba285fb'
implementation 'com.github.tibbi:subsampling-scale-image-view:224582bc99'
implementation 'com.github.tibbi:subsampling-scale-image-view:f8559f7f43'
kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work
kapt 'androidx.room:room-compiler:2.0.0'

View file

@ -380,7 +380,7 @@ class PhotoFragment : ViewPagerFragment() {
}
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
if (mIsFragmentVisible && degrees == 0) {
if (mIsFragmentVisible) {
scheduleZoomableView()
}
return false
@ -408,7 +408,7 @@ class PhotoFragment : ViewPagerFragment() {
picasso.into(mView.gestures_view, object : Callback {
override fun onSuccess() {
mView.gestures_view.controller.settings.isZoomEnabled = degrees != 0 || context?.config?.allowZoomingImages == false
if (mIsFragmentVisible && degrees == 0) {
if (mIsFragmentVisible) {
scheduleZoomableView()
}
}
@ -429,7 +429,7 @@ class PhotoFragment : ViewPagerFragment() {
private fun scheduleZoomableView() {
mLoadZoomableViewHandler.removeCallbacksAndMessages(null)
mLoadZoomableViewHandler.postDelayed({
if (mIsFragmentVisible && context?.config?.allowZoomingImages == true && mMedium.isImage() && !mIsSubsamplingVisible && mCurrentRotationDegrees == 0) {
if (mIsFragmentVisible && context?.config?.allowZoomingImages == true && mMedium.isImage() && !mIsSubsamplingVisible) {
addZoomableView()
}
}, ZOOMABLE_VIEW_LOAD_DELAY)
@ -459,7 +459,7 @@ class PhotoFragment : ViewPagerFragment() {
beVisible()
isQuickScaleEnabled = config.oneFingerZoom
isOneToOneZoomEnabled = config.allowOneToOneZoom
orientation = rotation
orientation = rotation + mCurrentRotationDegrees
setImage(path)
onImageEventListener = object : SubsamplingScaleImageView.OnImageEventListener {
override fun onReady() {
@ -550,7 +550,6 @@ class PhotoFragment : ViewPagerFragment() {
fun rotateImageViewBy(degrees: Int) {
mCurrentRotationDegrees = degrees
mLoadZoomableViewHandler.removeCallbacksAndMessages(null)
mView.subsampling_view.beGone()
mIsSubsamplingVisible = false
loadBitmap(degrees)
}