|
|
@ -27,7 +27,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio |
|
|
|
var author: String = "" |
|
|
|
var author: String = "" |
|
|
|
private var task: Coroutine<*>? = null |
|
|
|
private var task: Coroutine<*>? = null |
|
|
|
private var screenKey: String = "" |
|
|
|
private var screenKey: String = "" |
|
|
|
private val searchBooks = linkedSetOf<SearchBook>() |
|
|
|
private val searchBooks = hashSetOf<SearchBook>() |
|
|
|
|
|
|
|
|
|
|
|
fun initData(arguments: Bundle?) { |
|
|
|
fun initData(arguments: Bundle?) { |
|
|
|
arguments?.let { bundle -> |
|
|
|
arguments?.let { bundle -> |
|
|
@ -50,11 +50,9 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun upAdapter() { |
|
|
|
private fun upAdapter() { |
|
|
|
execute { |
|
|
|
|
|
|
|
val books = searchBooks.toList() |
|
|
|
val books = searchBooks.toList() |
|
|
|
searchBooksLiveData.postValue(books.sortedBy { it.originOrder }) |
|
|
|
searchBooksLiveData.postValue(books.sortedBy { it.originOrder }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun searchFinish(searchBook: SearchBook) { |
|
|
|
private fun searchFinish(searchBook: SearchBook) { |
|
|
|
App.db.searchBookDao().insert(searchBook) |
|
|
|
App.db.searchBookDao().insert(searchBook) |
|
|
|