문자열 리소스 참조로 화면 문구 정리
This commit is contained in:
@@ -5,8 +5,10 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.orhanobut.logger.Logger
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
|
||||
|
||||
class TalkTabViewModel(private val repository: TalkTabRepository) : BaseViewModel() {
|
||||
|
||||
@@ -59,13 +61,15 @@ class TalkTabViewModel(private val repository: TalkTabRepository) : BaseViewMode
|
||||
}
|
||||
} else {
|
||||
_toastLiveData.value =
|
||||
response.message ?: "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
response.message ?: SodaLiveApplicationHolder.get()
|
||||
.getString(R.string.msg_can_coupon_unknown_error)
|
||||
}
|
||||
},
|
||||
{ throwable ->
|
||||
_isLoading.value = false
|
||||
throwable.message?.let { message -> Logger.e(message) }
|
||||
_toastLiveData.value = "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
_toastLiveData.value = SodaLiveApplicationHolder.get()
|
||||
.getString(R.string.msg_can_coupon_unknown_error)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -23,6 +23,7 @@ import kr.co.vividnext.sodalive.base.SodaDialog
|
||||
import kr.co.vividnext.sodalive.chat.character.detail.detail.CharacterType
|
||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
|
||||
import kr.co.vividnext.sodalive.databinding.ActivityChatRoomBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
@@ -538,7 +539,10 @@ class ChatRoomActivity : BaseActivity<ActivityChatRoomBinding>(
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
ensureQuotaNoticeShown("00:00:00")
|
||||
ensureQuotaNoticeShown(
|
||||
SodaLiveApplicationHolder.get()
|
||||
.getString(R.string.screen_audio_content_detail_time_default)
|
||||
)
|
||||
checkQuotaStatus()
|
||||
}
|
||||
}.start()
|
||||
@@ -565,7 +569,12 @@ class ChatRoomActivity : BaseActivity<ActivityChatRoomBinding>(
|
||||
val ms = if (epoch < 1_000_000_000_000L) epoch * 1000 else epoch
|
||||
val remain = ms - System.currentTimeMillis()
|
||||
val displayMs = (remain + DISPLAY_FUDGE_MS).coerceAtLeast(0L)
|
||||
return if (displayMs > 0L) formatMillisToHms(displayMs) else "00:00:00"
|
||||
return if (displayMs > 0L) {
|
||||
formatMillisToHms(displayMs)
|
||||
} else {
|
||||
SodaLiveApplicationHolder.get()
|
||||
.getString(R.string.screen_audio_content_detail_time_default)
|
||||
}
|
||||
}
|
||||
|
||||
private fun formatMillisToHms(ms: Long): String {
|
||||
@@ -780,7 +789,9 @@ class ChatRoomActivity : BaseActivity<ActivityChatRoomBinding>(
|
||||
)
|
||||
}, { error ->
|
||||
isLoading = false
|
||||
showToast(error.message ?: getString(R.string.chat_previous_messages_load_failed))
|
||||
showToast(
|
||||
error.message ?: getString(R.string.chat_previous_messages_load_failed)
|
||||
)
|
||||
})
|
||||
|
||||
compositeDisposable.add(disposable)
|
||||
@@ -793,10 +804,10 @@ class ChatRoomActivity : BaseActivity<ActivityChatRoomBinding>(
|
||||
*/
|
||||
private fun onPurchaseMessageClicked(message: ChatMessage) {
|
||||
// 조건 확인: AI 메시지이며 잠금 상태여야 함
|
||||
val isLock = (message.price != null) && (message.hasAccess == false)
|
||||
val isLock = (message.price != null) && !message.hasAccess
|
||||
if (message.mine || !isLock) return
|
||||
|
||||
val priceText = message.price?.toString() ?: "0"
|
||||
val priceText = message.price.toString()
|
||||
val title = getString(R.string.chat_locked_message_title)
|
||||
val desc = getString(R.string.chat_locked_message_desc, priceText)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user