From e27906e1ec74940d6fd8913fe649c0873d10de41 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 13 Dec 2021 21:50:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 + } } } }