pull/1319/head
gedoor 3 years ago
parent ec528a5ecd
commit 3fcd954070
  1. 7
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 11
      app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt

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

@ -8,7 +8,6 @@ import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
@ -262,16 +261,6 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
}
}
companion object {
fun show(fragmentManager: FragmentManager, tocRegex: String? = null) {
val dialog = TocRegexDialog()
val bundle = Bundle()
bundle.putString("tocRegex", tocRegex)
dialog.arguments = bundle
dialog.show(fragmentManager, "tocRegexDialog")
}
}
interface CallBack {
fun onTocRegexDialogResult(tocRegex: String) {}
}

Loading…
Cancel
Save