forked from upstream-mirrors/quik
Disable GalleryActivity transitions and fix GIF playback
This commit is contained in:
@@ -77,7 +77,8 @@ class GalleryActivity : QkActivity(), GalleryView {
|
|||||||
window.sharedElementReturnTransition = transition
|
window.sharedElementReturnTransition = transition
|
||||||
window.sharedElementEnterTransition = transition
|
window.sharedElementEnterTransition = transition
|
||||||
|
|
||||||
image.transitionName = intent.getLongExtra("partId", 0L).toString()
|
// FIXME: Setting a transitionName breaks GIF playback
|
||||||
|
// image.transitionName = intent.getLongExtra("partId", 0L).toString()
|
||||||
|
|
||||||
// When calling the public setter, it doesn't allow the midscale to be the same as the
|
// When calling the public setter, it doesn't allow the midscale to be the same as the
|
||||||
// maxscale or the minscale. We don't want 3 levels and we don't want to modify the library
|
// maxscale or the minscale. We don't want 3 levels and we don't want to modify the library
|
||||||
@@ -114,13 +115,25 @@ class GalleryActivity : QkActivity(), GalleryView {
|
|||||||
image.setVisible(true)
|
image.setVisible(true)
|
||||||
video.setVisible(false)
|
video.setVisible(false)
|
||||||
if (image.drawable == null) {
|
if (image.drawable == null) {
|
||||||
GlideApp.with(this)
|
|
||||||
.load(uri)
|
// We need to explicitly request a gif from glide for animations to work
|
||||||
.dontAnimate()
|
when (uri?.let(contentResolver::getType)) {
|
||||||
.listener(GlideCompletionListener {
|
ContentType.IMAGE_GIF -> GlideApp.with(this)
|
||||||
startPostponedEnterTransition()
|
.asGif()
|
||||||
})
|
.load(uri)
|
||||||
.into(image)
|
.listener(GlideCompletionListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
})
|
||||||
|
.into(image)
|
||||||
|
|
||||||
|
else -> GlideApp.with(this)
|
||||||
|
.asBitmap()
|
||||||
|
.load(uri)
|
||||||
|
.listener(GlideCompletionListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
})
|
||||||
|
.into(image)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user