mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
73aa53a363
commit
4620bb8b28
@ -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…
Reference in New Issue
Block a user