pull/94/head
kunfei 5 years ago
parent 73aa53a363
commit 4620bb8b28
  1. 8
      app/src/main/java/io/legado/app/help/ActivityHelp.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  3. 3
      app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt

@ -19,7 +19,7 @@ object ActivityHelp {
* 判断指定Activity是否存在 * 判断指定Activity是否存在
*/ */
fun isExist(activityClass: Class<*>): Boolean { fun isExist(activityClass: Class<*>): Boolean {
for (item in activities) { activities.forEach { item ->
if (item.get()?.javaClass == activityClass) { if (item.get()?.javaClass == activityClass) {
return true return true
} }
@ -63,7 +63,7 @@ object ActivityHelp {
* 关闭指定 activity * 关闭指定 activity
*/ */
fun finishActivity(vararg activities: Activity) { fun finishActivity(vararg activities: Activity) {
for (activity in activities) { activities.forEach { activity ->
activity.finish() activity.finish()
} }
} }
@ -81,8 +81,8 @@ object ActivityHelp {
} }
} }
} }
for (activityWeakReference in waitFinish) { waitFinish.forEach {
activityWeakReference.get()?.finish() it.get()?.finish()
} }
} }

@ -496,6 +496,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
} }
} }
/**
* colorSelectDialog
*/
override fun onColorSelected(dialogId: Int, color: Int) = with(ReadBookConfig.getConfig()) { override fun onColorSelected(dialogId: Int, color: Int) = with(ReadBookConfig.getConfig()) {
when (dialogId) { when (dialogId) {
TEXT_COLOR -> { TEXT_COLOR -> {

@ -30,10 +30,9 @@ class WelcomeActivity : BaseActivity(R.layout.activity_welcome) {
} }
welAnimator.addListener(object : Animator.AnimatorListener { welAnimator.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator) { override fun onAnimationStart(animation: Animator) {
startActivity<MainActivity>()
if (getPrefBoolean(getString(R.string.pk_default_read))) { if (getPrefBoolean(getString(R.string.pk_default_read))) {
startActivity<ReadBookActivity>() startActivity<ReadBookActivity>()
} else {
startActivity<MainActivity>()
} }
finish() finish()
} }

Loading…
Cancel
Save