From ff5b4d2126437b5102da91de782128cca5193c45 Mon Sep 17 00:00:00 2001 From: dagu <1184313565@qq.com> Date: Mon, 13 Dec 2021 12:54:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=AD=A3=E6=96=87=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=94=AE=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 7 ++++++- app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/pref_config_read.xml | 7 +++++++ 9 files changed, 20 insertions(+), 1 deletion(-) 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 4c8f48f62..282f4606e 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) { + if (menuLayoutIsVisible && !getPrefBoolean("disableReturnKey")) { return super.onKeyDown(keyCode, event) } when { @@ -367,6 +367,11 @@ 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) } diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 892a59490..390591901 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -696,6 +696,7 @@ Switch Layout Text font weight switching Full screen gestures support + Disable return key Primario diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index b308ada13..011b25d7a 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -700,6 +700,7 @@ Switch Layout Text font weight switching Full screen gestures support + Disable return key Primary diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 5326f806e..5bd8148c5 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -700,6 +700,7 @@ Alterar o layout Alteração de tamanho da fonte de texto Suporte aos gestos em tela completa + 禁用返回键 Primário diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index b36e44594..77bb68e3b 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -688,6 +688,7 @@ 信息 切換佈局 全面屏手勢優化 + 禁用返回鍵 主色調 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 46dcab31e..3691f8108 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -699,6 +699,7 @@ 切換布局 文章字重轉換 全面屏手勢最佳化 + 禁用返回鍵 主色調 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 3628cd445..46f7b1baa 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -699,6 +699,7 @@ 切换布局 文章字重切换 全面屏手势优化 + 禁用返回键 主色调 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb6208c7c..cae0e2eae 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -700,6 +700,7 @@ Switch Layout Text font weight switching Full screen gestures support + Disable return key Primary diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml index 7ad5985df..bda589697 100644 --- a/app/src/main/res/xml/pref_config_read.xml +++ b/app/src/main/res/xml/pref_config_read.xml @@ -110,6 +110,13 @@ app:iconSpaceReserved="false" app:isBottomBackground="true" /> + + Date: Mon, 13 Dec 2021 13:03:02 +0800 Subject: [PATCH 2/2] fix bug --- app/src/main/res/values-es-rES/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 390591901..e81482927 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -696,7 +696,7 @@ Switch Layout Text font weight switching Full screen gestures support - Disable return key + Disable return key Primario