오디오 콘텐츠 신규/인기/테마 화면 문자열 리소스화

This commit is contained in:
2025-12-03 13:52:12 +09:00
parent a3fb090593
commit 96d14356be
15 changed files with 75 additions and 44 deletions

View File

@@ -49,16 +49,16 @@ class AudioContentNewAllActivity : BaseActivity<ActivityAudioContentNewAllBindin
override fun setupView() {
loadingDialog = LoadingDialog(this, layoutInflater)
binding.toolbar.tvBack.text = if (isFree) {
"새로운 무료 콘텐츠"
getString(R.string.screen_audio_content_new_all_title_free)
} else {
"새로운 단편"
getString(R.string.screen_audio_content_new_all_title)
}
binding.toolbar.tvBack.setOnClickListener { finish() }
binding.tvNotice.text = if (isFree) {
"※ 최근 2주간 등록된 새로운 콘텐츠 입니다."
getString(R.string.screen_audio_content_new_all_notice_free)
} else {
"※ 최근 2주간 등록된 새로운 단편 입니다."
getString(R.string.screen_audio_content_new_all_notice)
}
setupNewContentTheme()

View File

@@ -68,7 +68,7 @@ class AudioContentNewAllAdapter(
binding.tvCan.text = item.price.moneyFormat()
} else {
binding.ivCan.visibility = View.GONE
binding.tvCan.text = "무료"
binding.tvCan.text = context.getString(R.string.audio_content_price_free)
}
binding.tvTime.text = item.duration

View File

@@ -8,7 +8,9 @@ import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentMainItem
import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.R
class AudioContentNewAllViewModel(
private val repository: AudioContentRepository
@@ -41,6 +43,7 @@ class AudioContentNewAllViewModel(
fun getNewContentList(isFree: Boolean = false) {
if (!_isLoading.value!! && !isLast) {
_isLoading.value = true
val unknownError = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
compositeDisposable.add(
repository.getNewContentAllOfTheme(
@@ -67,9 +70,7 @@ class AudioContentNewAllViewModel(
if (it.message != null) {
_toastLiveData.postValue(it.message)
} else {
_toastLiveData.postValue(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
_toastLiveData.postValue(unknownError)
}
}
@@ -78,7 +79,7 @@ class AudioContentNewAllViewModel(
{
_isLoading.value = false
it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
_toastLiveData.postValue(unknownError)
}
)
)
@@ -86,6 +87,7 @@ class AudioContentNewAllViewModel(
}
fun getThemeList() {
val unknownError = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
compositeDisposable.add(
repository.getNewContentThemeList(token = "Bearer ${SharedPreferenceManager.token}")
.subscribeOn(Schedulers.io())
@@ -98,9 +100,7 @@ class AudioContentNewAllViewModel(
if (it.message != null) {
_toastLiveData.postValue(it.message)
} else {
_toastLiveData.postValue(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
_toastLiveData.postValue(unknownError)
}
}
@@ -109,7 +109,7 @@ class AudioContentNewAllViewModel(
{
_isLoading.value = false
it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
_toastLiveData.postValue(unknownError)
}
)
)

View File

@@ -8,6 +8,7 @@ import android.view.View
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.audio_content.detail.AudioContentDetailActivity
import kr.co.vividnext.sodalive.audio_content.main.new_content.AudioContentMainNewContentThemeAdapter
import kr.co.vividnext.sodalive.base.BaseActivity
@@ -37,7 +38,7 @@ class AudioContentRankingAllActivity : BaseActivity<ActivityAudioContentRankingA
override fun setupView() {
loadingDialog = LoadingDialog(this, layoutInflater)
binding.toolbar.tvBack.setOnClickListener { finish() }
binding.toolbar.tvBack.text = "인기 콘텐츠"
binding.toolbar.tvBack.text = getString(R.string.screen_audio_content_ranking_title)
adapter = AudioContentRankingAllAdapter {
val intent = Intent(applicationContext, AudioContentDetailActivity::class.java)

View File

@@ -43,7 +43,7 @@ class AudioContentRankingAllAdapter(
binding.tvNickname.text = item.creatorNickname
if (item.price < 1) {
binding.tvPrice.text = "무료"
binding.tvPrice.text = context.getString(R.string.audio_content_price_free)
binding.tvPrice.setTextColor(ContextCompat.getColor(context, R.color.white))
binding.tvPrice.setCompoundDrawables(null, null, null, null)
binding.tvPrice.setPadding(

View File

@@ -8,7 +8,9 @@ import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRankingItem
import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.R
class AudioContentRankingAllViewModel(
private val repository: AudioContentRepository
@@ -42,6 +44,7 @@ class AudioContentRankingAllViewModel(
fun getAudioContentRanking() {
if (!_isLoading.value!! && !isLast && page <= 5) {
_isLoading.value = true
val unknownError = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
compositeDisposable.add(
repository.getContentRanking(
page = page,
@@ -69,15 +72,13 @@ class AudioContentRankingAllViewModel(
if (it.message != null) {
_toastLiveData.postValue(it.message)
} else {
_toastLiveData.postValue(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
_toastLiveData.postValue(unknownError)
}
}
},
{
it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
_toastLiveData.postValue(unknownError)
}
)
)
@@ -85,6 +86,7 @@ class AudioContentRankingAllViewModel(
}
fun getAudioContentRankingSortType() {
val unknownError = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
compositeDisposable.add(
repository.getContentRankingSortType(token = "Bearer ${SharedPreferenceManager.token}")
.subscribeOn(Schedulers.io())
@@ -97,15 +99,13 @@ class AudioContentRankingAllViewModel(
if (it.message != null) {
_toastLiveData.postValue(it.message)
} else {
_toastLiveData.postValue(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
_toastLiveData.postValue(unknownError)
}
}
},
{
it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
_toastLiveData.postValue(unknownError)
}
)
)

View File

@@ -38,7 +38,7 @@ class AudioContentAllByThemeActivity : BaseActivity<ActivityAudioContentAllByThe
if (themeId <= 0) {
Toast.makeText(
applicationContext,
"잘못된 요청입니다.\n다시 시도해 주세요.",
getString(R.string.screen_audio_content_error_invalid_request_retry),
Toast.LENGTH_LONG
).show()

View File

@@ -8,7 +8,9 @@ import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.audio_content.AudioContentRepository
import kr.co.vividnext.sodalive.audio_content.AudioContentViewModel
import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.R
class AudioContentAllByThemeViewModel(
private val repository: AudioContentRepository
@@ -61,7 +63,8 @@ class AudioContentAllByThemeViewModel(
_toastLiveData.postValue(it.message)
} else {
_toastLiveData.postValue(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
SodaLiveApplicationHolder.get()
.getString(R.string.common_error_unknown)
)
}
}
@@ -71,7 +74,10 @@ class AudioContentAllByThemeViewModel(
{
_isLoading.value = false
it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
_toastLiveData.postValue(
SodaLiveApplicationHolder.get()
.getString(R.string.common_error_unknown)
)
}
)
)