parent
0e70ed2661
commit
e46c34558e
|
@ -325,7 +325,7 @@ interface AudioContentApi {
|
|||
@Query("page") page: Int,
|
||||
@Query("size") size: Int,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<List<GetAudioContentMainItem>>>
|
||||
): Single<ApiResponse<GetNewContentAllResponse>>
|
||||
|
||||
@GET("/v2/audio-content/main/asmr")
|
||||
fun getContentMainAsmr(
|
||||
|
|
|
@ -102,7 +102,7 @@ class AudioContentMainTabAlarmViewModel(
|
|||
.subscribe(
|
||||
{
|
||||
if (it.success && it.data != null) {
|
||||
_newContentListLiveData.value = it.data!!
|
||||
_newContentListLiveData.value = it.data.items
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
|
|
|
@ -154,5 +154,9 @@ class AlarmContentAllActivity : BaseActivity<ActivityAlarmContentAllBinding>(
|
|||
viewModel.newContentListLiveData.observe(this) {
|
||||
newContentAdapter.addItems(it)
|
||||
}
|
||||
|
||||
viewModel.totalCountLiveData.observe(this) {
|
||||
binding.tvTotalCount.text = "$it"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@ class AlarmContentAllViewModel(
|
|||
val newContentListLiveData: LiveData<List<GetAudioContentMainItem>>
|
||||
get() = _newContentListLiveData
|
||||
|
||||
private var _totalCountLiveData = MutableLiveData<Int>()
|
||||
val totalCountLiveData: LiveData<Int>
|
||||
get() = _totalCountLiveData
|
||||
|
||||
private var isLast = false
|
||||
private var page = 1
|
||||
private val size = 10
|
||||
|
@ -50,9 +54,11 @@ class AlarmContentAllViewModel(
|
|||
.subscribe(
|
||||
{
|
||||
if (it.success && it.data != null) {
|
||||
if (it.data.isNotEmpty()) {
|
||||
val data = it.data
|
||||
_totalCountLiveData.value = data.totalCount
|
||||
if (data.items.isNotEmpty()) {
|
||||
page += 1
|
||||
_newContentListLiveData.value = it.data!!
|
||||
_newContentListLiveData.value = data.items
|
||||
} else {
|
||||
isLast = true
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ class AsmrNewContentAllActivity : BaseActivity<ActivityAsmrNewContentAllBinding>
|
|||
binding.toolbar.tvBack.text = "새로운 ASMR"
|
||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||
|
||||
binding.tvNotice.text = "※ 최근 2주간 등록된 새로운 ASMR 입니다."
|
||||
|
||||
setupNewContent()
|
||||
}
|
||||
|
||||
|
@ -106,5 +108,9 @@ class AsmrNewContentAllActivity : BaseActivity<ActivityAsmrNewContentAllBinding>
|
|||
viewModel.newContentListLiveData.observe(this) {
|
||||
newContentAdapter.addItems(it)
|
||||
}
|
||||
|
||||
viewModel.newContentTotalCountLiveData.observe(this) {
|
||||
binding.tvTotalCount.text = "$it"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ class ReplayNewContentAllActivity : BaseActivity<ActivityAsmrNewContentAllBindin
|
|||
binding.toolbar.tvBack.text = "새로운 라이브 다시듣기"
|
||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||
|
||||
binding.tvNotice.text = "※ 최근 2주간 등록된 새로운 라이브 다시보기 입니다."
|
||||
|
||||
setupNewContent()
|
||||
}
|
||||
|
||||
|
@ -104,5 +106,9 @@ class ReplayNewContentAllActivity : BaseActivity<ActivityAsmrNewContentAllBindin
|
|||
viewModel.newContentListLiveData.observe(this) {
|
||||
newContentAdapter.addItems(it)
|
||||
}
|
||||
|
||||
viewModel.newContentTotalCountLiveData.observe(this) {
|
||||
binding.tvTotalCount.text = "$it"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,46 @@
|
|||
android:clipToPadding="false"
|
||||
android:paddingHorizontal="13.3dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingVertical="6.7dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="전체"
|
||||
android:textColor="@color/color_e2e2e2"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_total_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_ff5c49"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="개"
|
||||
android:textColor="@color/color_e2e2e2"
|
||||
android:textSize="13.3sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_content"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
layout="@layout/detail_toolbar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_notice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13.3dp"
|
||||
|
@ -20,6 +21,46 @@
|
|||
android:text="※ 최근 2주간 등록된 새로운 ASMR 입니다."
|
||||
android:textSize="14.67sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingVertical="6.7dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="전체"
|
||||
android:textColor="@color/color_e2e2e2"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_total_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_ff5c49"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="개"
|
||||
android:textColor="@color/color_e2e2e2"
|
||||
android:textSize="13.3sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_content"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
android:layout_marginTop="13.3dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingVertical="13.3dp">
|
||||
android:paddingVertical="6.7dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
Loading…
Reference in New Issue