pull/1463/head^2
gedoor 3 years ago
parent 3ca75dc95a
commit e27906e1ec
  1. 13
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -329,7 +329,7 @@ class ReadBookActivity : BaseReadBookActivity(),
* 按键事件 * 按键事件
*/ */
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (menuLayoutIsVisible && !getPrefBoolean("disableReturnKey")) { if (menuLayoutIsVisible) {
return super.onKeyDown(keyCode, event) return super.onKeyDown(keyCode, event)
} }
when { when {
@ -367,11 +367,6 @@ class ReadBookActivity : BaseReadBookActivity(),
binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT) binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT)
return true return true
} }
keyCode == KeyEvent.KEYCODE_BACK -> {
if (getPrefBoolean("disableReturnKey")) {
return true
}
}
} }
return super.onKeyDown(keyCode, event) return super.onKeyDown(keyCode, event)
} }
@ -414,6 +409,12 @@ class ReadBookActivity : BaseReadBookActivity(),
autoPageStop() autoPageStop()
return true return true
} }
if (getPrefBoolean("disableReturnKey")) {
if (menuLayoutIsVisible) {
finish()
}
return true
}
} }
} }
} }

Loading…
Cancel
Save