|
|
@ -86,6 +86,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), |
|
|
|
override fun onPostCreate(savedInstanceState: Bundle?) { |
|
|
|
override fun onPostCreate(savedInstanceState: Bundle?) { |
|
|
|
super.onPostCreate(savedInstanceState) |
|
|
|
super.onPostCreate(savedInstanceState) |
|
|
|
upVersion() |
|
|
|
upVersion() |
|
|
|
|
|
|
|
privacyPolicy() |
|
|
|
//自动更新书籍 |
|
|
|
//自动更新书籍 |
|
|
|
if (AppConfig.autoRefreshBook) { |
|
|
|
if (AppConfig.autoRefreshBook) { |
|
|
|
binding.viewPagerMain.postDelayed(1000) { |
|
|
|
binding.viewPagerMain.postDelayed(1000) { |
|
|
@ -149,8 +150,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), |
|
|
|
if (LocalConfig.isFirstOpenApp) { |
|
|
|
if (LocalConfig.isFirstOpenApp) { |
|
|
|
val help = String(assets.open("help/appHelp.md").readBytes()) |
|
|
|
val help = String(assets.open("help/appHelp.md").readBytes()) |
|
|
|
showDialogFragment(TextDialog(help, TextDialog.Mode.MD)) |
|
|
|
showDialogFragment(TextDialog(help, TextDialog.Mode.MD)) |
|
|
|
val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) |
|
|
|
|
|
|
|
showDialogFragment(TextDialog(privacyPolicy, TextDialog.Mode.MD)) |
|
|
|
|
|
|
|
} else if (!BuildConfig.DEBUG) { |
|
|
|
} else if (!BuildConfig.DEBUG) { |
|
|
|
val log = String(assets.open("updateLog.md").readBytes()) |
|
|
|
val log = String(assets.open("updateLog.md").readBytes()) |
|
|
|
showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) |
|
|
|
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 { |
|
|
|
override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { |
|
|
|
event?.let { |
|
|
|
event?.let { |
|
|
|
when (keyCode) { |
|
|
|
when (keyCode) { |
|
|
|