mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -180,9 +180,11 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
||||
customView { alertBinding.root }
|
||||
okButton {
|
||||
alertBinding.apply {
|
||||
var notifyMain = false
|
||||
var recreate = false
|
||||
if (AppConfig.bookGroupStyle != spGroupStyle.selectedItemPosition) {
|
||||
AppConfig.bookGroupStyle = spGroupStyle.selectedItemPosition
|
||||
postEvent(EventBus.NOTIFY_MAIN, false)
|
||||
notifyMain = true
|
||||
}
|
||||
if (AppConfig.showUnread != swShowUnread.isChecked) {
|
||||
AppConfig.showUnread = swShowUnread.isChecked
|
||||
@@ -211,7 +213,12 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
||||
} else {
|
||||
activityViewModel.booksListRecycledViewPool.clear()
|
||||
}
|
||||
recreate = true
|
||||
}
|
||||
if (recreate) {
|
||||
postEvent(EventBus.RECREATE, "")
|
||||
} else if (notifyMain) {
|
||||
postEvent(EventBus.NOTIFY_MAIN, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user