|
|
@ -13,7 +13,6 @@ import io.legado.app.BuildConfig |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.constant.Bus |
|
|
|
import io.legado.app.constant.Bus |
|
|
|
import io.legado.app.data.AppDatabase |
|
|
|
|
|
|
|
import io.legado.app.help.ActivityHelp |
|
|
|
import io.legado.app.help.ActivityHelp |
|
|
|
import io.legado.app.help.permission.Permissions |
|
|
|
import io.legado.app.help.permission.Permissions |
|
|
|
import io.legado.app.help.permission.PermissionsCompat |
|
|
|
import io.legado.app.help.permission.PermissionsCompat |
|
|
@ -48,7 +47,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager) |
|
|
|
view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager) |
|
|
|
view_pager_main.addOnPageChangeListener(this) |
|
|
|
view_pager_main.addOnPageChangeListener(this) |
|
|
|
bottom_navigation_view.setOnNavigationItemSelectedListener(this) |
|
|
|
bottom_navigation_view.setOnNavigationItemSelectedListener(this) |
|
|
|
restore() |
|
|
|
|
|
|
|
upVersion() |
|
|
|
upVersion() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -63,7 +61,7 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun restore() { |
|
|
|
private fun restore() { |
|
|
|
if (AppDatabase.DestructiveMigration) return |
|
|
|
|
|
|
|
launch { |
|
|
|
launch { |
|
|
|
if (withContext(IO) { App.db.bookDao().allBookCount == 0 }) { |
|
|
|
if (withContext(IO) { App.db.bookDao().allBookCount == 0 }) { |
|
|
|
alert(title = "导入") { |
|
|
|
alert(title = "导入") { |
|
|
|