|
|
@ -3,14 +3,19 @@ package io.legado.app.ui.book.read.config |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
import android.util.DisplayMetrics |
|
|
|
import android.util.DisplayMetrics |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.LayoutInflater |
|
|
|
|
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.view.ViewGroup |
|
|
|
import android.view.ViewGroup |
|
|
|
|
|
|
|
import androidx.appcompat.widget.Toolbar |
|
|
|
import androidx.fragment.app.FragmentManager |
|
|
|
import androidx.fragment.app.FragmentManager |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseDialogFragment |
|
|
|
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 { |
|
|
|
companion object { |
|
|
|
fun show(fragmentManager: FragmentManager, tocRegex: String? = null) { |
|
|
|
fun show(fragmentManager: FragmentManager, tocRegex: String? = null) { |
|
|
@ -39,6 +44,14 @@ class TocRegexDialog : BaseDialogFragment() { |
|
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |