구매 목록 - 구매한 콘텐츠 총 개수 표시
This commit is contained in:
@@ -123,5 +123,9 @@ class AudioContentOrderListActivity : BaseActivity<ActivityAudioContentOrderList
|
||||
adapter.items.addAll(it)
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
viewModel.totalCount.observe(this) {
|
||||
binding.tvTotalCount.text = "$it"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user