From 4e5e8c698bd78be0aada734494cf5d44752931ce Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 25 Sep 2019 22:37:36 +0800 Subject: [PATCH] up --- .../app/ui/book/source/manage/BookSourceActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 a71483930..4ece6fc99 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 @@ -166,24 +166,24 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity @SuppressLint("InflateParams") private fun showImportDialog() { val aCache = ACache.get(this, cacheDir = false) - val cacheUrls: MutableList? = aCache + val cacheUrls: MutableList = aCache .getAsString("sourceUrl") ?.splitNotBlank(",") - ?.toMutableList() + ?.toMutableList() ?: mutableListOf() alert(titleResource = R.string.import_book_source_on_line) { var editText: ATEAutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { editText = edit_view edit_view.setFilterValues(cacheUrls) { - cacheUrls?.remove(it) + cacheUrls.remove(it) } } } okButton { val text = editText?.text?.toString() text?.let { - if (cacheUrls?.contains(it) == true) { + if (!cacheUrls.contains(it)) { cacheUrls.add(0, it) aCache.put("sourceUrl", cacheUrls.joinToString(",")) }