This commit is contained in:
Horis
2025-03-06 17:58:47 +08:00
parent 75a41a4a11
commit 371408a519

View File

@@ -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)
}
}
}