feat(live-room): 사용하지 않는 후원현황 채팅 제거
This commit is contained in:
@@ -79,7 +79,6 @@ import kr.co.vividnext.sodalive.live.room.chat.LiveRoomChatAdapter
|
|||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomChatRawMessage
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomChatRawMessage
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomChatRawMessageType
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomChatRawMessageType
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomDonationChat
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomDonationChat
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomDonationStatusChat
|
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomJoinChat
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomJoinChat
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomNormalChat
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomNormalChat
|
||||||
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomRouletteDonationChat
|
import kr.co.vividnext.sodalive.live.room.chat.LiveRoomRouletteDonationChat
|
||||||
@@ -1776,18 +1775,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveRoomChatRawMessageType.DONATION_STATUS -> {
|
|
||||||
handler.post {
|
|
||||||
chatAdapter.items.add(
|
|
||||||
LiveRoomDonationStatusChat(
|
|
||||||
donationStatusString = rawMessage.message
|
|
||||||
)
|
|
||||||
)
|
|
||||||
chatAdapter.notifyDataSetChanged()
|
|
||||||
invalidateChat()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LiveRoomChatRawMessageType.TOGGLE_ROULETTE -> {
|
LiveRoomChatRawMessageType.TOGGLE_ROULETTE -> {
|
||||||
activatingRouletteButton(
|
activatingRouletteButton(
|
||||||
isActiveRoulette = rawMessage.isActiveRoulette ?: false
|
isActiveRoulette = rawMessage.isActiveRoulette ?: false
|
||||||
|
|||||||
@@ -83,76 +83,6 @@ data class LiveRoomJoinChat(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Keep
|
|
||||||
data class LiveRoomDonationStatusChat(
|
|
||||||
val response: GetLiveRoomDonationStatusResponse? = null,
|
|
||||||
val donationStatusString: String? = null
|
|
||||||
) : LiveRoomChat() {
|
|
||||||
override var type = LiveRoomChatType.DONATION_STATUS
|
|
||||||
override fun bind(context: Context, binding: ViewBinding, onClickProfile: ((Long) -> Unit)?) {
|
|
||||||
if (donationStatusString != null) {
|
|
||||||
(binding as ItemLiveRoomDonationStatusChatBinding)
|
|
||||||
.tvDonationList
|
|
||||||
.text = donationStatusString
|
|
||||||
} else {
|
|
||||||
(binding as ItemLiveRoomDonationStatusChatBinding)
|
|
||||||
.tvDonationList
|
|
||||||
.text = getDonationString(context)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDonationString(context: Context): String {
|
|
||||||
if (response != null) {
|
|
||||||
var donationStatusString: CharSequence = "[현재 라이브 후원현황]\n\n"
|
|
||||||
for (index in response.donationList.indices) {
|
|
||||||
val donation = response.donationList[index]
|
|
||||||
val spChars = SpannableString(
|
|
||||||
"${index + 1}. " +
|
|
||||||
if (donation.nickname.length > 10) {
|
|
||||||
"${donation.nickname.substring(0, 10)} : "
|
|
||||||
} else {
|
|
||||||
"${donation.nickname} : "
|
|
||||||
} + "(${donation.can.moneyFormat()} 캔)\n"
|
|
||||||
)
|
|
||||||
spChars.setSpan(
|
|
||||||
ForegroundColorSpan(
|
|
||||||
ContextCompat.getColor(
|
|
||||||
context,
|
|
||||||
R.color.color_fdca2f
|
|
||||||
)
|
|
||||||
),
|
|
||||||
spChars.indexOf(": (") + 3,
|
|
||||||
spChars.indexOf(")"),
|
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
|
||||||
)
|
|
||||||
|
|
||||||
donationStatusString = TextUtils.concat(
|
|
||||||
donationStatusString, spChars
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
donationStatusString = TextUtils.concat(
|
|
||||||
donationStatusString,
|
|
||||||
"\n-------------------------\n\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
donationStatusString = TextUtils.concat(
|
|
||||||
donationStatusString,
|
|
||||||
"후원인원 : ${response.totalCount} 명\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
donationStatusString = TextUtils.concat(
|
|
||||||
donationStatusString,
|
|
||||||
"후원합계 : ${response.totalCan.moneyFormat()} 캔"
|
|
||||||
)
|
|
||||||
|
|
||||||
return donationStatusString.toString()
|
|
||||||
} else {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
data class LiveRoomNormalChat(
|
data class LiveRoomNormalChat(
|
||||||
@SerializedName("userId") val userId: Long,
|
@SerializedName("userId") val userId: Long,
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ enum class LiveRoomChatRawMessageType {
|
|||||||
@SerializedName("EDIT_ROOM_INFO")
|
@SerializedName("EDIT_ROOM_INFO")
|
||||||
EDIT_ROOM_INFO,
|
EDIT_ROOM_INFO,
|
||||||
|
|
||||||
@SerializedName("DONATION_STATUS")
|
|
||||||
DONATION_STATUS,
|
|
||||||
|
|
||||||
@SerializedName("TOGGLE_ROULETTE")
|
@SerializedName("TOGGLE_ROULETTE")
|
||||||
TOGGLE_ROULETTE,
|
TOGGLE_ROULETTE,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user