diff --git a/app/src/main/java/io/legado/app/constant/EventBus.kt b/app/src/main/java/io/legado/app/constant/EventBus.kt index 402827cb4..88031b4fc 100644 --- a/app/src/main/java/io/legado/app/constant/EventBus.kt +++ b/app/src/main/java/io/legado/app/constant/EventBus.kt @@ -20,6 +20,5 @@ object EventBus { const val SHOW_RSS = "showRss" const val WEB_SERVICE_STOP = "webServiceStop" const val UP_DOWNLOAD = "upDownload" - const val UP_TABS = "upTabs" const val SAVE_CONTENT = "saveContent" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index a3a228dd7..9cb7dc9de 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -15,7 +15,6 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseFragment import io.legado.app.constant.AppConst -import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.data.entities.BookGroup import io.legado.app.lib.dialogs.alert @@ -25,10 +24,10 @@ import io.legado.app.lib.dialogs.okButton import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.ui.book.arrange.ArrangeBookActivity -import io.legado.app.ui.book.group.GroupManageDialog -import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.download.DownloadActivity +import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.local.ImportBookActivity +import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.dialog_bookshelf_config.view.* @@ -99,9 +98,6 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b TabLayoutMediator(tab_layout, view_pager_bookshelf) { tab, position -> tab.text = bookGroups[position].groupName }.attach() - observeEvent(EventBus.UP_TABS) { - tab_layout.getTabAt(it)?.select() - } } private fun initBookGroupData() { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index 95b5b1431..5d922cae9 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -57,9 +57,6 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), } initRecyclerView() upRecyclerData() - observeEvent(EventBus.UP_BOOK) { - booksAdapter.notification(it) - } } private fun initRecyclerView() { @@ -135,4 +132,10 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), return bookUrl in activityViewModel.updateList } + override fun observeLiveBus() { + super.observeLiveBus() + observeEvent(EventBus.UP_BOOK) { + booksAdapter.notification(it) + } + } } \ No newline at end of file