From 8b735f36d7dfa982b435df674c13cb2c906397ad Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 7 Mar 2021 22:43:06 +0100 Subject: [PATCH] adding some GIF and SVG improvements --- .../gallery/pro/fragments/PhotoFragment.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index e5a80b9e3..88a2641bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -374,8 +374,10 @@ class PhotoFragment : ViewPagerFragment() { mView.apply { gestures_view.beGone() - gif_view.setInputSource(source) gif_view_frame.beVisible() + ensureBackgroundThread { + gif_view.setInputSource(source) + } } } catch (e: Exception) { loadBitmap() @@ -385,11 +387,13 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadSVG() { - Glide.with(context!!) - .`as`(PictureDrawable::class.java) - .listener(SvgSoftwareLayerSetter()) - .load(mMedium.path) - .into(mView.gestures_view) + if (context != null) { + Glide.with(context!!) + .`as`(PictureDrawable::class.java) + .listener(SvgSoftwareLayerSetter()) + .load(mMedium.path) + .into(mView.gestures_view) + } } private fun loadBitmap(addZoomableView: Boolean = true) {