diff --git a/app/src/main/java/io/legado/app/help/ActivityHelp.kt b/app/src/main/java/io/legado/app/help/ActivityHelp.kt index ca7c20f5f..6138c0c7e 100644 --- a/app/src/main/java/io/legado/app/help/ActivityHelp.kt +++ b/app/src/main/java/io/legado/app/help/ActivityHelp.kt @@ -19,7 +19,7 @@ object ActivityHelp { * 判断指定Activity是否存在 */ fun isExist(activityClass: Class<*>): Boolean { - for (item in activities) { + activities.forEach { item -> if (item.get()?.javaClass == activityClass) { return true } @@ -63,7 +63,7 @@ object ActivityHelp { * 关闭指定 activity */ fun finishActivity(vararg activities: Activity) { - for (activity in activities) { + activities.forEach { activity -> activity.finish() } } @@ -81,8 +81,8 @@ object ActivityHelp { } } } - for (activityWeakReference in waitFinish) { - activityWeakReference.get()?.finish() + waitFinish.forEach { + it.get()?.finish() } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 430aea351..7d7ef8c67 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -496,6 +496,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } + /** + * colorSelectDialog + */ override fun onColorSelected(dialogId: Int, color: Int) = with(ReadBookConfig.getConfig()) { when (dialogId) { TEXT_COLOR -> { diff --git a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt index 721257bf5..4a1e12f82 100644 --- a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt @@ -30,10 +30,9 @@ class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { } welAnimator.addListener(object : Animator.AnimatorListener { override fun onAnimationStart(animation: Animator) { + startActivity() if (getPrefBoolean(getString(R.string.pk_default_read))) { startActivity() - } else { - startActivity() } finish() }