From 382b2b18113c81320a3a96453531be2f4703165b Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 11 Feb 2020 17:00:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 5 +++++ .../io/legado/app/ui/main/bookshelf/BookshelfFragment.kt | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) 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 b7a6746d8..455a0de73 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 @@ -48,6 +48,11 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), bottom_navigation_view.setOnNavigationItemSelectedListener(this) bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = AppConfig.isShowRSS upVersion() + if (AppConfig.autoRefreshBook) { + view_pager_main.postDelayed({ + viewModel.upChapterList() + }, 1000) + } } override fun onNavigationItemSelected(item: MenuItem): Boolean { 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 7d5fb644d..b8dc704b3 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 @@ -17,7 +17,6 @@ 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.help.AppConfig import io.legado.app.lib.dialogs.* import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor @@ -27,7 +26,6 @@ import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.download.DownloadActivity import io.legado.app.ui.importbook.ImportBookActivity -import io.legado.app.ui.main.MainViewModel import io.legado.app.utils.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.fragment_bookshelf.* @@ -53,11 +51,6 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b setSupportToolbar(toolbar) initView() initBookGroupData() - if (AppConfig.autoRefreshBook) { - tab_layout.postDelayed({ - getViewModelOfActivity(MainViewModel::class.java).upChapterList() - }, 1000) - } } override fun onCompatCreateOptionsMenu(menu: Menu) {