diff --git a/app/src/main/java/com/gh/common/util/ImageUtils.kt b/app/src/main/java/com/gh/common/util/ImageUtils.kt index c995e01a55..6fa5f4fc54 100644 --- a/app/src/main/java/com/gh/common/util/ImageUtils.kt +++ b/app/src/main/java/com/gh/common/util/ImageUtils.kt @@ -426,9 +426,6 @@ object ImageUtils { // 低于 2G 运行内存的不加载 gif val shouldLoadAsGif = url.endsWith(".gif") - && isAutoPlayGif - && (HaloApp.getInstance().deviceRamSize == 0L || HaloApp.getInstance().deviceRamSize > 2500) - && view?.getTag(R.id.tag_show_gif) != false if (shouldLoadAsGif && view?.tag == url) return@execute @@ -440,7 +437,9 @@ object ImageUtils { highResUrl = resizeGif(url, view!!.width, height ?: 0) loadImageClosure(shouldLoadAsGif, highResUrl, lowResUrl) } else { - view?.post { + // view.post { } 里面的方法体在 MUMU 模拟器上不会被调用?????????????? + runOnUiThread { + view ?: return@runOnUiThread highResUrl = resizeGif(url, view.width, height ?: 0) loadImageClosure(shouldLoadAsGif, highResUrl, lowResUrl) } @@ -547,7 +546,9 @@ object ImageUtils { private fun resizeGif(url: String, width: Int, height: Int): String { val idealSize = getIdealGifSize(width, height) - return "$url?x-oss-process=image/resize,h_$idealSize,w_$idealSize".also { addCachedUrl(it) } + return "$url?x-oss-process=image/resize,h_$idealSize,w_$idealSize".also { addCachedUrl(it) + Utils.log(it) + } } private fun getIdealGifSize(width: Int, height: Int): String {