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