优化
This commit is contained in:
@@ -92,7 +92,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
||||
upBottomMenu()
|
||||
initView()
|
||||
upHomePage()
|
||||
viewModel.deleteNotShelfBook()
|
||||
onBackPressedDispatcher.addCallback(this) {
|
||||
if (pagePosition != 0) {
|
||||
binding.viewPagerMain.currentItem = 0
|
||||
|
||||
@@ -58,6 +58,10 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
|
||||
setMaxRecycledViews(0, 100)
|
||||
}
|
||||
|
||||
init {
|
||||
deleteNotShelfBook()
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
upTocPool.close()
|
||||
@@ -247,7 +251,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteNotShelfBook() {
|
||||
private fun deleteNotShelfBook() {
|
||||
execute {
|
||||
appDb.bookDao.deleteNotShelfBook()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user