콘텐츠 메인 단편 탭 - 새로운 콘텐츠 전체보기
- 새로운 콘텐츠가 없으면 '새로운 콘텐츠가 없습니다.' 문구 출력
This commit is contained in:
parent
8ed9e08a60
commit
6129982df4
|
@ -35,7 +35,7 @@ android {
|
|||
applicationId "kr.co.vividnext.sodalive"
|
||||
minSdk 23
|
||||
targetSdk 34
|
||||
versionCode 143
|
||||
versionCode 144
|
||||
versionName "1.28.0"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package kr.co.vividnext.sodalive.audio_content.all
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.os.Bundle
|
||||
|
@ -52,9 +53,11 @@ class AudioContentNewAllActivity : BaseActivity<ActivityAudioContentNewAllBindin
|
|||
setupNewContent()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun setupNewContentTheme() {
|
||||
newContentThemeAdapter = AudioContentMainNewContentThemeAdapter {
|
||||
newContentAdapter.clear()
|
||||
newContentAdapter.notifyDataSetChanged()
|
||||
viewModel.selectTheme(it, isFree = isFree)
|
||||
}
|
||||
|
||||
|
@ -157,6 +160,13 @@ class AudioContentNewAllActivity : BaseActivity<ActivityAudioContentNewAllBindin
|
|||
}
|
||||
|
||||
viewModel.newContentListLiveData.observe(this) {
|
||||
if (newContentAdapter.itemCount > 0 || it.isNotEmpty()) {
|
||||
binding.rvContent.visibility = View.VISIBLE
|
||||
binding.llNoItems.visibility = View.GONE
|
||||
} else {
|
||||
binding.rvContent.visibility = View.GONE
|
||||
binding.llNoItems.visibility = View.VISIBLE
|
||||
}
|
||||
newContentAdapter.addItems(it)
|
||||
}
|
||||
|
||||
|
|
|
@ -61,11 +61,12 @@ class AudioContentNewAllViewModel(
|
|||
if (it.success && it.data != null) {
|
||||
if (it.data.items.isNotEmpty()) {
|
||||
page += 1
|
||||
_newContentListLiveData.postValue(it.data.items)
|
||||
_newContentTotalCountLiveData.postValue(it.data.totalCount)
|
||||
} else {
|
||||
isLast = true
|
||||
}
|
||||
|
||||
_newContentListLiveData.postValue(it.data.items)
|
||||
_newContentTotalCountLiveData.postValue(it.data.totalCount)
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/black"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -72,5 +73,36 @@
|
|||
android:id="@+id/rv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false" />
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_no_items"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:background="@drawable/bg_round_corner_4_7_13181b"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="16.7dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_no_item" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:text="최근 2주간 등록된 새로운 콘텐츠가 없습니다."
|
||||
android:textColor="@color/color_bbbbbb"
|
||||
android:textSize="13sp"
|
||||
android:lineSpacingExtra="8dp"
|
||||
tools:ignore="SmallSp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in New Issue