diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 282f4606e..e4dd0732d 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/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 { - if (menuLayoutIsVisible && !getPrefBoolean("disableReturnKey")) { + if (menuLayoutIsVisible) { return super.onKeyDown(keyCode, event) } when { @@ -367,11 +367,6 @@ class ReadBookActivity : BaseReadBookActivity(), binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT) return true } - keyCode == KeyEvent.KEYCODE_BACK -> { - if (getPrefBoolean("disableReturnKey")) { - return true - } - } } return super.onKeyDown(keyCode, event) } @@ -414,6 +409,12 @@ class ReadBookActivity : BaseReadBookActivity(), autoPageStop() return true } + if (getPrefBoolean("disableReturnKey")) { + if (menuLayoutIsVisible) { + finish() + } + return true + } } } }