pull/1319/head
gedoor 3 years ago
parent b2ce0f070d
commit e57d745c0c
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 8
      app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt

@ -278,9 +278,9 @@ class ReadBookActivity : ReadBookBaseActivity(),
putExtra("author", it.author)
}
}
R.id.menu_toc_regex -> supportFragmentManager.showDialog<TocRegexDialog> {
putString("tocRegex", ReadBook.book?.tocUrl)
}
R.id.menu_toc_regex -> supportFragmentManager.showDialog(
TocRegexDialog(ReadBook.book?.tocUrl)
)
R.id.menu_reverse_content -> ReadBook.book?.let {
viewModel.reverseContent(it)
}

@ -34,7 +34,13 @@ import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import java.util.*
class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
class TocRegexDialog() : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
constructor(tocRegex: String?) : this() {
arguments = Bundle().apply {
putString("tocRegex", tocRegex)
}
}
private val importTocRuleKey = "tocRuleUrl"
private val viewModel: TocRegexViewModel by viewModels()

Loading…
Cancel
Save