From fc319e606d53703ec72da91bf455f4cc6fffeb64 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 22 Feb 2020 22:35:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/config/TocRegexDialog.kt | 15 ++++++++++++++- app/src/main/res/menu/read_book.xml | 2 +- app/src/main/res/menu/txt_toc_regex.xml | 4 ++++ app/src/main/res/values/strings.xml | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/menu/txt_toc_regex.xml diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt index 971cf998d..9ff3b69fe 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt @@ -3,14 +3,19 @@ package io.legado.app.ui.book.read.config import android.os.Bundle import android.util.DisplayMetrics import android.view.LayoutInflater +import android.view.MenuItem import android.view.View import android.view.ViewGroup +import androidx.appcompat.widget.Toolbar import androidx.fragment.app.FragmentManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment +import io.legado.app.constant.Theme +import io.legado.app.utils.applyTint +import kotlinx.android.synthetic.main.dialog_toc_regex.* -class TocRegexDialog : BaseDialogFragment() { +class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { companion object { fun show(fragmentManager: FragmentManager, tocRegex: String? = null) { @@ -39,6 +44,14 @@ class TocRegexDialog : BaseDialogFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + tool_bar.setTitle(R.string.txt_toc_regex) + tool_bar.inflateMenu(R.menu.txt_toc_regex) + tool_bar.menu.applyTint(requireContext(), Theme.getTheme()) + tool_bar.setOnMenuItemClickListener(this) + } + + override fun onMenuItemClick(item: MenuItem?): Boolean { + return false } } \ No newline at end of file diff --git a/app/src/main/res/menu/read_book.xml b/app/src/main/res/menu/read_book.xml index b27cd41ff..5d776e519 100644 --- a/app/src/main/res/menu/read_book.xml +++ b/app/src/main/res/menu/read_book.xml @@ -43,7 +43,7 @@ diff --git a/app/src/main/res/menu/txt_toc_regex.xml b/app/src/main/res/menu/txt_toc_regex.xml new file mode 100644 index 000000000..e73b6af79 --- /dev/null +++ b/app/src/main/res/menu/txt_toc_regex.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2aeb59f2a..9f1e0c46b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -334,7 +334,7 @@ 显示所有发现 关闭则只显示勾选源的发现 更新目录 - txt目录正则 + Txt目录正则 设置编码 倒序-顺序 排序