From f27081e49b0ee1c72bd9d430dbf5d97e6a8566e4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 22 May 2022 22:32:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BF=BB=E9=A1=B5=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/PageView.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 279249383..59a57020f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -65,18 +65,15 @@ class PageView(context: Context) : FrameLayout(context) { } fun getBitmap(): Bitmap? { - synchronized(this) { - return bitmap?.copy(Bitmap.Config.ARGB_8888, false) - } + return bitmap?.copy(Bitmap.Config.ARGB_8888, false) } private fun upBitmap() { Coroutine.async { - val screenshot = screenshot() + screenshot() + }.onSuccess { val tmp = bitmap - synchronized(this@PageView) { - bitmap = screenshot - } + bitmap = it tmp?.recycle() }.onError { AppLog.put("更新PageView图片出错", it)