|
|
|
@ -86,6 +86,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), |
|
|
|
|
override fun onPostCreate(savedInstanceState: Bundle?) { |
|
|
|
|
super.onPostCreate(savedInstanceState) |
|
|
|
|
upVersion() |
|
|
|
|
privacyPolicy() |
|
|
|
|
//自动更新书籍 |
|
|
|
|
if (AppConfig.autoRefreshBook) { |
|
|
|
|
binding.viewPagerMain.postDelayed(1000) { |
|
|
|
@ -149,8 +150,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), |
|
|
|
|
if (LocalConfig.isFirstOpenApp) { |
|
|
|
|
val help = String(assets.open("help/appHelp.md").readBytes()) |
|
|
|
|
showDialogFragment(TextDialog(help, TextDialog.Mode.MD)) |
|
|
|
|
val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) |
|
|
|
|
showDialogFragment(TextDialog(privacyPolicy, TextDialog.Mode.MD)) |
|
|
|
|
} else if (!BuildConfig.DEBUG) { |
|
|
|
|
val log = String(assets.open("updateLog.md").readBytes()) |
|
|
|
|
showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) |
|
|
|
@ -159,6 +158,19 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun privacyPolicy() { |
|
|
|
|
if (LocalConfig.privacyPolicyOk) return |
|
|
|
|
val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) |
|
|
|
|
alert("用户隐私与协议", privacyPolicy) { |
|
|
|
|
noButton { |
|
|
|
|
finish() |
|
|
|
|
} |
|
|
|
|
yesButton { |
|
|
|
|
LocalConfig.privacyPolicyOk = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { |
|
|
|
|
event?.let { |
|
|
|
|
when (keyCode) { |
|
|
|
|