From 3700f3849dc671b898bfc3d5d7bbd42f3b521f49 Mon Sep 17 00:00:00 2001 From: hingbong Date: Thu, 20 Feb 2020 10:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E5=8D=8F=E7=A8=8B=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=AE=80=E7=B9=81=E4=BD=93=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=BC=95=E6=93=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原本的初始化引擎会阻塞 app 启动, 导致 app 启动的时候会有挺长一段时间黑屏, 极大影响产品体验 --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 57c368a2c..38569115b 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -16,6 +16,7 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.help.AppConfig +import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.storage.Backup import io.legado.app.lib.theme.ATH import io.legado.app.service.BaseReadAloudService @@ -54,8 +55,8 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), upVersion() //初始化简繁转换引擎 when (AppConfig.chineseConverterType) { - 1 -> ZhConverterUtil.toSimple("初始化") - 2 -> ZhConverterUtil.toTraditional("初始化") + 1 -> Coroutine.async { ZhConverterUtil.toSimple("初始化") } + 2 -> Coroutine.async { ZhConverterUtil.toTraditional("初始化") } } //自动更新书籍 if (AppConfig.autoRefreshBook) {