pull/35/head
kunfei 5 years ago
parent e3a00202cc
commit 6d65581607
  1. 11
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt

@ -165,7 +165,7 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
@SuppressLint("InflateParams")
private fun showImportDialog() {
val cacheUrls: List<String>? = ACache
val cacheUrls: MutableList<String>? = ACache
.get(this, "cacheUrls", cacheDir = false)
.getAsString("sourceUrl")
?.splitNotBlank(";")
@ -176,12 +176,17 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
layoutInflater.inflate(R.layout.dialog_edit_text, null).apply {
editText = edit_view
edit_view.setFilterValues(cacheUrls) {
cacheUrls?.remove(it)
}
}
}
okButton {
editText?.text
val text = editText?.text?.toString()
text?.let {
if (cacheUrls?.contains(it) == true) {
cacheUrls.add(0, it)
}
}
}
cancelButton()
}.show().applyTint()

Loading…
Cancel
Save