修复 MUMU 模拟器无法显示部分图片的问题
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user