正文禁用返回键开关

pull/1463/head^2
dagu 3 years ago
parent 75ddba2730
commit ff5b4d2126
  1. 7
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 1
      app/src/main/res/values-es-rES/strings.xml
  3. 1
      app/src/main/res/values-ja-rJP/strings.xml
  4. 1
      app/src/main/res/values-pt-rBR/strings.xml
  5. 1
      app/src/main/res/values-zh-rHK/strings.xml
  6. 1
      app/src/main/res/values-zh-rTW/strings.xml
  7. 1
      app/src/main/res/values-zh/strings.xml
  8. 1
      app/src/main/res/values/strings.xml
  9. 7
      app/src/main/res/xml/pref_config_read.xml

@ -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) { if (menuLayoutIsVisible && !getPrefBoolean("disableReturnKey")) {
return super.onKeyDown(keyCode, event) return super.onKeyDown(keyCode, event)
} }
when { when {
@ -367,6 +367,11 @@ 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)
} }

@ -696,6 +696,7 @@
<string name="switchLayout">Switch Layout</string> <string name="switchLayout">Switch Layout</string>
<string name="text_font_weight_converter">Text font weight switching</string> <string name="text_font_weight_converter">Text font weight switching</string>
<string name="full_screen_gestures_support">Full screen gestures support</string> <string name="full_screen_gestures_support">Full screen gestures support</string>
<string name="readpage_disable_return_key">Disable return key</string>
<!--color--> <!--color-->
<string name="primary">Primario</string> <string name="primary">Primario</string>

@ -700,6 +700,7 @@
<string name="switchLayout">Switch Layout</string> <string name="switchLayout">Switch Layout</string>
<string name="text_font_weight_converter">Text font weight switching</string> <string name="text_font_weight_converter">Text font weight switching</string>
<string name="full_screen_gestures_support">Full screen gestures support</string> <string name="full_screen_gestures_support">Full screen gestures support</string>
<string name="disable_return_key">Disable return key</string>
<!--color--> <!--color-->
<string name="primary">Primary</string> <string name="primary">Primary</string>

@ -700,6 +700,7 @@
<string name="switchLayout">Alterar o layout</string> <string name="switchLayout">Alterar o layout</string>
<string name="text_font_weight_converter">Alteração de tamanho da fonte de texto</string> <string name="text_font_weight_converter">Alteração de tamanho da fonte de texto</string>
<string name="full_screen_gestures_support">Suporte aos gestos em tela completa</string> <string name="full_screen_gestures_support">Suporte aos gestos em tela completa</string>
<string name="disable_return_key">禁用返回键</string>
<!--color--> <!--color-->
<string name="primary">Primário</string> <string name="primary">Primário</string>

@ -688,6 +688,7 @@
<string name="information">信息</string> <string name="information">信息</string>
<string name="switchLayout">切換佈局</string> <string name="switchLayout">切換佈局</string>
<string name="full_screen_gestures_support">全面屏手勢優化</string> <string name="full_screen_gestures_support">全面屏手勢優化</string>
<string name="disable_return_key">禁用返回鍵</string>
<!--color--> <!--color-->
<string name="primary">主色調</string> <string name="primary">主色調</string>

@ -699,6 +699,7 @@
<string name="switchLayout">切換布局</string> <string name="switchLayout">切換布局</string>
<string name="text_font_weight_converter">文章字重轉換</string> <string name="text_font_weight_converter">文章字重轉換</string>
<string name="full_screen_gestures_support">全面屏手勢最佳化</string> <string name="full_screen_gestures_support">全面屏手勢最佳化</string>
<string name="disable_return_key">禁用返回鍵</string>
<!--color--> <!--color-->
<string name="primary">主色調</string> <string name="primary">主色調</string>

@ -699,6 +699,7 @@
<string name="switchLayout">切换布局</string> <string name="switchLayout">切换布局</string>
<string name="text_font_weight_converter">文章字重切换</string> <string name="text_font_weight_converter">文章字重切换</string>
<string name="full_screen_gestures_support">全面屏手势优化</string> <string name="full_screen_gestures_support">全面屏手势优化</string>
<string name="disable_return_key">禁用返回键</string>
<!--color--> <!--color-->
<string name="primary">主色调</string> <string name="primary">主色调</string>

@ -700,6 +700,7 @@
<string name="switchLayout">Switch Layout</string> <string name="switchLayout">Switch Layout</string>
<string name="text_font_weight_converter">Text font weight switching</string> <string name="text_font_weight_converter">Text font weight switching</string>
<string name="full_screen_gestures_support">Full screen gestures support</string> <string name="full_screen_gestures_support">Full screen gestures support</string>
<string name="disable_return_key">Disable return key</string>
<!--color--> <!--color-->
<string name="primary">Primary</string> <string name="primary">Primary</string>

@ -110,6 +110,13 @@
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:isBottomBackground="true" /> app:isBottomBackground="true" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="disableReturnKey"
android:title="@string/disable_return_key"
app:iconSpaceReserved="false"
app:isBottomBackground="true" />
<io.legado.app.ui.widget.prefs.SwitchPreference <io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="fullScreenGesturesSupport" android:key="fullScreenGesturesSupport"

Loading…
Cancel
Save