|
|
|
@ -36,12 +36,17 @@ class HistoryView(
|
|
|
|
|
|
|
|
|
|
val historyAdapter = HistoryAdapter(interactor).apply {
|
|
|
|
|
addLoadStateListener {
|
|
|
|
|
adapterItemCount = itemCount
|
|
|
|
|
Log.d("hehehaha", "adapterItemCount = $adapterItemCount")
|
|
|
|
|
// first call will always have itemCount == 0, but we want to keep adapterItemCount
|
|
|
|
|
// as null until we can distinguish an empty list from populated, so updateEmptyState()
|
|
|
|
|
// could work correctly
|
|
|
|
|
if (itemCount != 0) {
|
|
|
|
|
adapterItemCount = itemCount
|
|
|
|
|
}
|
|
|
|
|
if (it.source.refresh is LoadState.NotLoading &&
|
|
|
|
|
it.append.endOfPaginationReached &&
|
|
|
|
|
itemCount < 1
|
|
|
|
|
) {
|
|
|
|
|
adapterItemCount = 0
|
|
|
|
|
onZeroItemsLoaded.invoke()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|