feat: 修复恢复时需要退出重进的bug

pull/248/head
gedoor 5 years ago
parent 57565e0c14
commit 5b0323d492
  1. 22
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -105,16 +105,17 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
view_pager_main.currentItem = 0
return true
}
if (!BaseReadAloudService.pause) {
if (System.currentTimeMillis() - exitTime > 2000) {
toast(R.string.double_click_exit)
exitTime = System.currentTimeMillis()
if (System.currentTimeMillis() - exitTime > 2000) {
toast(R.string.double_click_exit)
exitTime = System.currentTimeMillis()
} else {
if (BaseReadAloudService.pause) {
finish()
} else {
moveTaskToBack(true)
return true
}
return false
}
return true
}
}
}
@ -128,15 +129,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
}
}
override fun finish() {
if (System.currentTimeMillis() - exitTime > 2000) {
toast(R.string.double_click_exit)
exitTime = System.currentTimeMillis()
} else {
super.finish()
}
}
override fun onDestroy() {
super.onDestroy()
ReadAloud.stop(this)

Loading…
Cancel
Save