|
|
@ -40,7 +40,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio |
|
|
|
|
|
|
|
|
|
|
|
private fun upAdapter() { |
|
|
|
private fun upAdapter() { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
callBack?.adapter()?.let { |
|
|
|
callBack?.changeSourceAdapter?.let { |
|
|
|
val books = searchBooks.toList() |
|
|
|
val books = searchBooks.toList() |
|
|
|
books.sorted() |
|
|
|
books.sorted() |
|
|
|
val diffResult = DiffUtil.calculateDiff(DiffCallBack(it.getItems(), books)) |
|
|
|
val diffResult = DiffUtil.calculateDiff(DiffCallBack(it.getItems(), books)) |
|
|
@ -131,7 +131,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface CallBack { |
|
|
|
interface CallBack { |
|
|
|
fun adapter(): ChangeSourceAdapter |
|
|
|
var changeSourceAdapter: ChangeSourceAdapter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onCleared() { |
|
|
|
override fun onCleared() { |
|
|
|