fix #981, avoid some glitches related to GIF playing

This commit is contained in:
tibbi 2018-10-05 10:51:12 +02:00
parent 27a0bcdd1f
commit 641610842b
1 changed files with 21 additions and 6 deletions

View File

@ -163,11 +163,15 @@ class PhotoFragment : ViewPagerFragment() {
initExtendedDetails()
}
if (wasInit && (config.allowZoomingImages != storedAllowDeepZoomableImages || config.showHighestQuality != storedShowHighestQuality ||
config.oneFingerZoom != storedAllowOneFingerZoom)) {
isSubsamplingVisible = false
view.subsampling_view.beGone()
loadImage()
if (wasInit) {
if (config.allowZoomingImages != storedAllowDeepZoomableImages || config.showHighestQuality != storedShowHighestQuality ||
config.oneFingerZoom != storedAllowOneFingerZoom) {
isSubsamplingVisible = false
view.subsampling_view.beGone()
loadImage()
} else if (medium.isGIF()) {
loadGif()
}
}
val allowPhotoGestures = config.allowPhotoGestures
@ -518,7 +522,18 @@ class PhotoFragment : ViewPagerFragment() {
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
loadImage()
// avoid GIFs being skewed, played in wrong aspect ratio
if (medium.isGIF()) {
view.onGlobalLayout {
Handler().postDelayed({
loadGif()
}, 50)
}
} else {
loadImage()
}
initExtendedDetails()
}