diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index df1202bc8..ca7add879 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -165,7 +165,7 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity @SuppressLint("InflateParams") private fun showImportDialog() { - val cacheUrls: List? = ACache + val cacheUrls: MutableList? = ACache .get(this, "cacheUrls", cacheDir = false) .getAsString("sourceUrl") ?.splitNotBlank(";") @@ -176,12 +176,17 @@ class BookSourceActivity : VMBaseActivity(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()