From 8a6bfcda0284b15fa0d2ac41495360be12d1953f Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 23 May 2022 15:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= 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, 9 insertions(+), 2 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 062384559..6f8fac6eb 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 @@ -14,6 +14,7 @@ import io.legado.app.data.entities.Bookmark import io.legado.app.databinding.ViewBookPageBinding import io.legado.app.help.config.ReadBookConfig import io.legado.app.help.config.ReadTipConfig +import io.legado.app.help.coroutine.Coroutine import io.legado.app.model.ReadBook import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.read.page.entities.TextPage @@ -66,8 +67,14 @@ class PageView(context: Context) : FrameLayout(context) { } private fun upBitmap() { - bitmap?.recycle() - bitmap = screenshot() + post { + Coroutine.async { + screenshot() + }.onSuccess { + bitmap?.recycle() + bitmap = screenshot() + } + } } fun upStyle() = binding.run {