구매 목록 - 구매한 콘텐츠 총 개수 표시
This commit is contained in:
parent
0226a696d4
commit
d8cc218139
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
|
@ -9,9 +10,44 @@
|
|||
android:id="@+id/toolbar"
|
||||
layout="@layout/detail_toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_total_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="13.3dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="총 "
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_total_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:textColor="@color/color_dd4500"
|
||||
android:textSize="12sp"
|
||||
tools:text=" 10" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text=" 개"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_order_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="6.7dp" />
|
||||
android:layout_marginTop="13.3dp" />
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in New Issue