시리즈 회차 목록 문자열 리소스화
This commit is contained in:
@@ -47,7 +47,7 @@ class SeriesContentAdapter(
|
||||
} else if (item.isRented) {
|
||||
binding.tvRented.visibility = View.VISIBLE
|
||||
} else if (item.price > 0) {
|
||||
binding.tvPrice.text = "${item.price}"
|
||||
binding.tvPrice.text = item.price.toString()
|
||||
binding.tvPrice.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.tvPriceFree.visibility = View.VISIBLE
|
||||
|
||||
@@ -30,7 +30,11 @@ class SeriesContentAllActivity : BaseActivity<ActivitySeriesContentAllBinding>(
|
||||
|
||||
val seriesId = intent.getLongExtra(Constants.EXTRA_SERIES_ID, 0)
|
||||
if (seriesId <= 0) {
|
||||
Toast.makeText(applicationContext, "잘못된 요청입니다.", Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(
|
||||
applicationContext,
|
||||
getString(R.string.screen_audio_content_error_invalid_request),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
finish()
|
||||
}
|
||||
|
||||
@@ -45,9 +49,12 @@ class SeriesContentAllActivity : BaseActivity<ActivitySeriesContentAllBinding>(
|
||||
|
||||
val seriesTitle = intent.getStringExtra(Constants.EXTRA_SERIES_TITLE) ?: ""
|
||||
binding.toolbar.tvBack.text = if (seriesTitle.isNotBlank()) {
|
||||
"$seriesTitle - 전체회차 듣기"
|
||||
getString(
|
||||
R.string.screen_series_content_all_title_format,
|
||||
seriesTitle
|
||||
)
|
||||
} else {
|
||||
" 전체회차 듣기"
|
||||
getString(R.string.screen_series_content_all_title_default)
|
||||
}
|
||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import kr.co.vividnext.sodalive.audio_content.series.SeriesRepository
|
||||
import kr.co.vividnext.sodalive.audio_content.series.detail.GetSeriesContentListItem
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
|
||||
import kr.co.vividnext.sodalive.R
|
||||
|
||||
class SeriesContentAllViewModel(private val repository: SeriesRepository) : BaseViewModel() {
|
||||
private val _toastLiveData = MutableLiveData<String?>()
|
||||
@@ -33,6 +35,8 @@ class SeriesContentAllViewModel(private val repository: SeriesRepository) : Base
|
||||
var page = 1
|
||||
private var pageSize = 10
|
||||
private var isLast = false
|
||||
private val unknownErrorMessage: String
|
||||
get() = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
|
||||
|
||||
fun getSeriesContentList() {
|
||||
if (!_isLoading.value!! && !isLast) {
|
||||
@@ -59,18 +63,14 @@ class SeriesContentAllViewModel(private val repository: SeriesRepository) : Base
|
||||
isLast = true
|
||||
}
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.value = it.message
|
||||
} else {
|
||||
_toastLiveData.value = "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
}
|
||||
_toastLiveData.value = it.message ?: unknownErrorMessage
|
||||
}
|
||||
_isLoading.value = false
|
||||
},
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user