From 6d6558160718c86fb0b4fadf201f3fbbcd9b924f Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 25 Sep 2019 22:18:35 +0800 Subject: [PATCH] up --- .../app/ui/book/source/manage/BookSourceActivity.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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()