From d451fc64a698c41b21627ba52fb6af48db848859 Mon Sep 17 00:00:00 2001 From: xiaojie Date: Thu, 21 Nov 2024 16:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=A3=E7=A0=81=E5=A4=A7?= =?UTF-8?q?=E5=9B=BE=E6=97=B6=E7=9A=84=E5=8E=8B=E7=BC=A9=E5=80=8D=E7=8E=87?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/hippo/lib/image/Image.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/hippo/lib/image/Image.kt b/app/src/main/java/com/hippo/lib/image/Image.kt index 89e0f4f83..05938e43a 100644 --- a/app/src/main/java/com/hippo/lib/image/Image.kt +++ b/app/src/main/java/com/hippo/lib/image/Image.kt @@ -54,7 +54,7 @@ class Image private constructor( init { mObtainedDrawable = null source?.let { - var simpleSize = 1 + var simpleSize: Int? = null if (source.available() > 10485760) { simpleSize = source.available() / 10485760 + 1 } @@ -77,7 +77,7 @@ class Image private constructor( info.size.height / (2 * screenHeight) ).coerceAtLeast(1) decoder.setTargetSampleSize( - max(screenSize, simpleSize) + max(screenSize, simpleSize ?: 1) ) // Don't } @@ -227,6 +227,7 @@ class Image private constructor( return 0 } + @get:SuppressWarnings("deprecation") val isOpaque: Boolean get() { return mObtainedDrawable?.opacity == PixelFormat.OPAQUE