feat: 优化代码

pull/132/head
kunfei 5 years ago
parent c59a7f0444
commit c4ecbe6567
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt

@ -31,7 +31,7 @@ import io.legado.app.lib.dialogs.okButton
import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.ui.widget.recycler.VerticalDivider
import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.ui.widget.text.AutoCompleteTextView
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.android.synthetic.main.dialog_edit_text.* import kotlinx.android.synthetic.main.dialog_edit_text.view.*
import kotlinx.android.synthetic.main.dialog_toc_regex.* import kotlinx.android.synthetic.main.dialog_toc_regex.*
import kotlinx.android.synthetic.main.dialog_toc_regex_edit.view.* import kotlinx.android.synthetic.main.dialog_toc_regex_edit.view.*
import kotlinx.android.synthetic.main.item_toc_regex.view.* import kotlinx.android.synthetic.main.item_toc_regex.view.*
@ -140,14 +140,14 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
?.splitNotBlank(",") ?.splitNotBlank(",")
?.toMutableList() ?.toMutableList()
?: mutableListOf() ?: mutableListOf()
if (cacheUrls.contains(defaultUrl)) { if (!cacheUrls.contains(defaultUrl)) {
cacheUrls.add(0, defaultUrl) cacheUrls.add(0, defaultUrl)
} }
requireContext().alert(titleResource = R.string.import_book_source_on_line) { requireContext().alert(titleResource = R.string.import_book_source_on_line) {
var editText: AutoCompleteTextView? = null var editText: AutoCompleteTextView? = null
customView { customView {
layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply {
editText = edit_view editText = this.edit_view
edit_view.setFilterValues(cacheUrls) edit_view.setFilterValues(cacheUrls)
edit_view.delCallBack = { edit_view.delCallBack = {
cacheUrls.remove(it) cacheUrls.remove(it)

Loading…
Cancel
Save