From 65b2abe60d6cde0ade489d47bdc79a2aa3c3dec7 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 15 Nov 2019 21:10:47 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 1 - .../io/legado/app/ui/book/read/config/MoreConfigDialog.kt | 8 ++++++++ app/src/main/res/layout/dialog_page_key.xml | 2 +- app/src/main/res/menu/read_book.xml | 4 ---- app/src/main/res/values/strings.xml | 3 +-- app/src/main/res/xml/pref_config_read.xml | 5 +++++ 6 files changed, 15 insertions(+), 8 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 c532d3af3..95b2151c3 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 @@ -152,7 +152,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo viewModel.refreshContent(it) } } - R.id.menu_page_key -> PageKeyDialog(this).show() } return super.onCompatOptionsItemSelected(item) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt index 1175f3293..61d2801f3 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt @@ -9,6 +9,7 @@ import android.view.View import android.view.ViewGroup import android.widget.LinearLayout import androidx.fragment.app.DialogFragment +import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import io.legado.app.R import io.legado.app.constant.Bus @@ -97,5 +98,12 @@ class MoreConfigDialog : DialogFragment() { } } + override fun onPreferenceTreeClick(preference: Preference?): Boolean { + when (preference?.key) { + "customPageKey" -> PageKeyDialog(requireContext()).show() + } + return super.onPreferenceTreeClick(preference) + } + } } \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_page_key.xml b/app/src/main/res/layout/dialog_page_key.xml index 92c3293c1..9ee5fd289 100644 --- a/app/src/main/res/layout/dialog_page_key.xml +++ b/app/src/main/res/layout/dialog_page_key.xml @@ -12,7 +12,7 @@ android:layout_margin="5dp" android:textSize="18sp" android:textStyle="bold" - android:text="@string/custom_page_key_t" /> + android:text="@string/custom_page_key" /> - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 24434145a..f402dda09 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -556,8 +556,7 @@ 音频 转到后台 正在导入 - 定义翻页按键 - 自定义翻页按键 + 自定义翻页按键 上一页按键 下一页按键 diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml index 7c3a38460..4d996bd8d 100644 --- a/app/src/main/res/xml/pref_config_read.xml +++ b/app/src/main/res/xml/pref_config_read.xml @@ -26,4 +26,9 @@ android:key="volumeKeyPageOnPlay" app:iconSpaceReserved="false" /> + + \ No newline at end of file