From c2b99552da04365fc6c3dcc96fdae95333bff441 Mon Sep 17 00:00:00 2001 From: klaus Date: Thu, 7 Dec 2023 04:18:42 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EB=B0=A9=20?= =?UTF-8?q?=EB=A3=B0=EB=A0=9B=20-=20=EB=A3=B0=EB=A0=9B=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=20=EC=A0=84=EC=86=A1=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=20=EB=A3=B0=EB=A0=9B=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=EC=99=84=EB=A3=8C=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/vividnext/sodalive/live/room/LiveRoomActivity.kt | 7 +++---- .../co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt | 3 ++- .../live/roulette/config/RouletteSettingsViewModel.kt | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/live/room/LiveRoomActivity.kt b/app/src/main/java/kr/co/vividnext/sodalive/live/room/LiveRoomActivity.kt index d764259..16f070d 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/live/room/LiveRoomActivity.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/live/room/LiveRoomActivity.kt @@ -1260,11 +1260,10 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private fun spinRoulette() { viewModel.spinRoulette(roomId = roomId) { can, items, randomlySelectedItem -> - val rawMessage = "[$randomlySelectedItem] 당첨!" val rouletteRawMessage = Gson().toJson( LiveRoomChatRawMessage( type = LiveRoomChatRawMessageType.ROULETTE_DONATION, - message = rawMessage, + message = randomlySelectedItem, can = can, donationMessage = "", ) @@ -1284,7 +1283,7 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB LiveRoomRouletteDonationChat( profileUrl = SharedPreferenceManager.profileImage, nickname = SharedPreferenceManager.nickname, - chat = rawMessage + rouletteResult = randomlySelectedItem ) ) invalidateChat() @@ -1388,7 +1387,7 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB LiveRoomRouletteDonationChat( profileUrl = profileUrl, nickname = nickname, - chat = rawMessage.message + rouletteResult = rawMessage.message ) ) invalidateChat() diff --git a/app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt b/app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt index 85b9762..e281fb6 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt @@ -340,10 +340,11 @@ data class LiveRoomDonationChat( data class LiveRoomRouletteDonationChat( @SerializedName("profileUrl") val profileUrl: String, @SerializedName("nickname") val nickname: String, - @SerializedName("chat") val chat: String + @SerializedName("rouletteResult") val rouletteResult: String ) : LiveRoomChat() { override fun bind(context: Context, binding: ViewBinding, onClickProfile: ((Long) -> Unit)?) { val itemBinding = binding as ItemLiveRoomChatBinding + val chat = "[$rouletteResult] 당첨!" val spChat = SpannableString(chat) spChat.setSpan( ForegroundColorSpan( diff --git a/app/src/main/java/kr/co/vividnext/sodalive/live/roulette/config/RouletteSettingsViewModel.kt b/app/src/main/java/kr/co/vividnext/sodalive/live/roulette/config/RouletteSettingsViewModel.kt index 2640860..f0f7aeb 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/live/roulette/config/RouletteSettingsViewModel.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/live/roulette/config/RouletteSettingsViewModel.kt @@ -139,7 +139,12 @@ class RouletteSettingsViewModel(private val repository: RouletteRepository) : Ba { _isLoading.value = false if (it.success && it.data != null && it.data is Boolean) { - _toastLiveData.postValue("룰렛이 설정되었습니다.") + val message = if (it.data) { + "룰렛을 활성화 했습니다." + } else { + "룰렛을 비활성화 했습니다." + } + _toastLiveData.postValue(message) onSuccess(it.data) } else { if (it.message != null) {