구매 목록 - 구매한 콘텐츠 총 개수 표시

This commit is contained in:
2023-10-31 18:35:07 +09:00
parent 0226a696d4
commit d8cc218139
3 changed files with 46 additions and 1 deletions

View File

@@ -123,5 +123,9 @@ class AudioContentOrderListActivity : BaseActivity<ActivityAudioContentOrderList
adapter.items.addAll(it)
adapter.notifyDataSetChanged()
}
viewModel.totalCount.observe(this) {
binding.tvTotalCount.text = "$it"
}
}
}

View File

@@ -25,6 +25,10 @@ class AudioContentOrderListViewModel(
val orderList: LiveData<List<GetAudioContentOrderListItem>>
get() = _orderList
private var _totalCount = MutableLiveData<Int>()
val totalCount: LiveData<Int>
get() = _totalCount
private var isLast = false
var page = 1
private val size = 10
@@ -43,6 +47,7 @@ class AudioContentOrderListViewModel(
.subscribe(
{
if (it.success && it.data != null) {
_totalCount.value = it.data.totalCount
if (it.data.items.isNotEmpty()) {
page += 1
_orderList.postValue(it.data.items)