diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index f08b3c250..9a9d7b9bd 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -133,7 +133,7 @@ class OtherConfigFragment : BasePreferenceFragment(), PreferKey.processText -> sharedPreferences?.let { setProcessTextEnable(it.getBoolean(key, true)) } - PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, "") + PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, true) PreferKey.defaultCover -> upPreferenceSummary( key, getPrefString(PreferKey.defaultCover) ) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 6b4bf86a6..c9ea98bd0 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -172,11 +172,13 @@ class MainActivity : VMBaseActivity(), observeEvent(EventBus.RECREATE) { recreate() } - observeEvent(EventBus.NOTIFY_MAIN) { + observeEvent(EventBus.NOTIFY_MAIN) { binding.apply { upBottomMenu() viewPagerMain.adapter?.notifyDataSetChanged() - viewPagerMain.setCurrentItem(bottomMenuCount - 1, false) + if (it) { + viewPagerMain.setCurrentItem(bottomMenuCount - 1, false) + } } } observeEvent(PreferKey.threadCount) { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt index 150eaeb8e..3fffdc73e 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import io.legado.app.R import io.legado.app.base.VMBaseFragment +import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.data.entities.Book import io.legado.app.databinding.DialogBookshelfConfigBinding @@ -93,7 +94,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment