Fully migrate to AdapterDelegates and cleanup code

This commit is contained in:
Koitharu
2020-11-28 11:05:27 +02:00
parent 53e36d23b1
commit 5ed4d0b6b7
48 changed files with 416 additions and 479 deletions

View File

@@ -43,15 +43,14 @@ class FeedViewModel(
if (loadingJob?.isActive == true) {
return
}
loadingJob = launchLoadingJob {
loadingJob = launchLoadingJob(Dispatchers.Default) {
val offset = if (append) logList.value.size else 0
val list = repository.getTrackingLog(offset, 20)
if (!append) {
logList.value = list
isEmptyState.postValue(list.isEmpty())
} else if (list.isNotEmpty()) {
logList.value += list
} else {
isEmptyState.value = true
}
hasNextPage.value = list.isNotEmpty()
}