From e7cb91cd34b7b6462a8157945706ffcf2420dbd5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 25 Sep 2020 21:36:06 +0200 Subject: [PATCH] fix a glitch with animated webp files stucking --- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 2 +- .../kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 c463053d7..54a10e28a 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 @@ -289,7 +289,7 @@ class PhotoFragment : ViewPagerFragment() { super.setMenuVisibility(menuVisible) mIsFragmentVisible = menuVisible if (mWasInit) { - if (!mMedium.isGIF()) { + if (!mMedium.isGIF() && !mMedium.isWebP()) { photoFragmentVisibilityChanged(menuVisible) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt index d1c03170f..d392bc1a1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt @@ -9,6 +9,7 @@ import com.bumptech.glide.signature.ObjectKey import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.extensions.getFilenameExtension +import com.simplemobiletools.commons.extensions.isWebP import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_NAME import com.simplemobiletools.commons.helpers.SORT_BY_PATH @@ -35,6 +36,8 @@ data class Medium( private const val serialVersionUID = -6553149366975655L } + fun isWebP() = name.isWebP() + fun isGIF() = type == TYPE_GIFS fun isImage() = type == TYPE_IMAGES