콘텐츠 메인 단편 탭 - 새로운 콘텐츠 전체보기

- 새로운 콘텐츠가 없으면 '새로운 콘텐츠가 없습니다.' 문구 출력
This commit is contained in:
2025-02-19 18:29:51 +09:00
parent 8ed9e08a60
commit 6129982df4
4 changed files with 47 additions and 4 deletions

View File

@@ -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)
}

View File

@@ -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)