재생목록 상세 문자열 리소스화
플레이리스트 상세 화면 문구를 ko/en/ja 리소스로 정리했습니다.
This commit is contained in:
@@ -173,8 +173,9 @@ class AudioContentPlaylistDetailActivity : BaseActivity<ActivityAudioContentPlay
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (playlistId <= 0) {
|
||||
showToast("잘못된 요청입니다.")
|
||||
showToast(getString(R.string.screen_audio_content_error_invalid_request))
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
bindData()
|
||||
@@ -283,16 +284,19 @@ class AudioContentPlaylistDetailActivity : BaseActivity<ActivityAudioContentPlay
|
||||
SodaDialog(
|
||||
activity = this@AudioContentPlaylistDetailActivity,
|
||||
layoutInflater = layoutInflater,
|
||||
title = "재생 목록 삭제",
|
||||
desc = "'${binding.tvTitle.text}'을 삭제하시겠습니까?",
|
||||
confirmButtonTitle = "삭제",
|
||||
title = getString(R.string.audio_content_playlist_detail_delete_title),
|
||||
desc = getString(
|
||||
R.string.audio_content_playlist_detail_delete_message,
|
||||
binding.tvTitle.text
|
||||
),
|
||||
confirmButtonTitle = getString(R.string.screen_audio_content_detail_delete),
|
||||
confirmButtonClick = {
|
||||
viewModel.deletePlaylist(playlistId = playlistId) {
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
},
|
||||
cancelButtonTitle = "취소",
|
||||
cancelButtonTitle = getString(R.string.cancel),
|
||||
cancelButtonClick = {}
|
||||
).show(screenWidth)
|
||||
}
|
||||
@@ -319,8 +323,14 @@ class AudioContentPlaylistDetailActivity : BaseActivity<ActivityAudioContentPlay
|
||||
viewModel.detailResponseLiveData.observe(this) {
|
||||
binding.tvDesc.text = it.desc
|
||||
binding.tvTitle.text = it.title
|
||||
binding.tvContentCount.text = " ${it.contentCount}개"
|
||||
binding.tvCreateDate.text = "만든 날짜 ${it.createdDate} "
|
||||
binding.tvContentCount.text = getString(
|
||||
R.string.audio_content_playlist_total_count,
|
||||
it.contentCount
|
||||
)
|
||||
binding.tvCreateDate.text = getString(
|
||||
R.string.audio_content_playlist_detail_created_date,
|
||||
it.createdDate
|
||||
)
|
||||
adapter.updateItems(it.contentList)
|
||||
this.contentList.clear()
|
||||
this.contentList.addAll(it.contentList)
|
||||
|
||||
@@ -7,6 +7,8 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kr.co.vividnext.sodalive.audio_content.playlist.AudioContentPlaylistRepository
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
|
||||
class AudioContentPlaylistDetailViewModel(
|
||||
@@ -24,6 +26,14 @@ class AudioContentPlaylistDetailViewModel(
|
||||
val detailResponseLiveData: LiveData<GetPlaylistDetailResponse>
|
||||
get() = _detailResponseLiveData
|
||||
|
||||
private val unknownErrorMessage: String
|
||||
get() = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
|
||||
|
||||
private val deleteSuccessMessage: String
|
||||
get() = SodaLiveApplicationHolder.get().getString(
|
||||
R.string.audio_content_playlist_detail_delete_success
|
||||
)
|
||||
|
||||
fun getPlaylistDetail(playlistId: Long) {
|
||||
_isLoading.value = true
|
||||
compositeDisposable.add(
|
||||
@@ -41,9 +51,7 @@ class AudioContentPlaylistDetailViewModel(
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
}
|
||||
_isLoading.value = false
|
||||
@@ -51,7 +59,7 @@ class AudioContentPlaylistDetailViewModel(
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -69,15 +77,13 @@ class AudioContentPlaylistDetailViewModel(
|
||||
.subscribe(
|
||||
{
|
||||
if (it.success) {
|
||||
_toastLiveData.value = "삭제되었습니다."
|
||||
_toastLiveData.value = deleteSuccessMessage
|
||||
onSuccess()
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
}
|
||||
_isLoading.value = false
|
||||
@@ -85,7 +91,7 @@ class AudioContentPlaylistDetailViewModel(
|
||||
{
|
||||
_isLoading.value = false
|
||||
it.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.postValue(unknownErrorMessage)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user