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是否存在
*/
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()
}
}

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

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

Loading…
Cancel
Save