fix(live-room): 라이브룸 채팅 랭킹 왕관 표시 규격을 조정한다

This commit is contained in:
2026-03-18 14:06:17 +09:00
parent f0977d9433
commit 544a67c8ec
2 changed files with 152 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.view.View
import android.view.ViewGroup
import androidx.annotation.Keep
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
@@ -111,6 +112,28 @@ data class LiveRoomNormalChat(
itemBinding.ivRoulette.visibility = View.GONE
itemBinding.tvCreatorOrManager.visibility = View.GONE
val defaultProfileSize = 33.3f.dpToPx().toInt()
val defaultCrownSize = 16.7f.dpToPx().toInt()
val rankProfileWidth = 39.dpToPx().toInt()
val rankProfileHeight = 38.dpToPx().toInt()
fun setProfileSize(width: Int, height: Int) {
itemBinding.flProfile.layoutParams = itemBinding.flProfile.layoutParams.apply {
this.width = width
this.height = height
}
}
fun setCrownSize(width: Int, height: Int) {
itemBinding.ivCrown.layoutParams = itemBinding.ivCrown.layoutParams.apply {
this.width = width
this.height = height
}
}
setProfileSize(defaultProfileSize, defaultProfileSize)
setCrownSize(defaultCrownSize, defaultCrownSize)
when (rank + 1) {
-2 -> {
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_4999e3)
@@ -132,20 +155,35 @@ data class LiveRoomNormalChat(
}
1 -> {
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_ffdc00_fdca2f)
itemBinding.ivCrown.setImageResource(R.drawable.ic_crown_1)
itemBinding.ivBg.setImageDrawable(null)
setProfileSize(rankProfileWidth, rankProfileHeight)
setCrownSize(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
itemBinding.ivCrown.setImageResource(R.drawable.img_rank_1)
itemBinding.ivCrown.visibility = View.VISIBLE
}
2 -> {
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_9f9f9f_dcdcdc)
itemBinding.ivCrown.setImageResource(R.drawable.ic_crown_2)
itemBinding.ivBg.setImageDrawable(null)
setProfileSize(rankProfileWidth, rankProfileHeight)
setCrownSize(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
itemBinding.ivCrown.setImageResource(R.drawable.img_rank_2)
itemBinding.ivCrown.visibility = View.VISIBLE
}
3 -> {
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_e5a578_c67e4a)
itemBinding.ivCrown.setImageResource(R.drawable.ic_crown_3)
itemBinding.ivBg.setImageDrawable(null)
setProfileSize(rankProfileWidth, rankProfileHeight)
setCrownSize(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
itemBinding.ivCrown.setImageResource(R.drawable.img_rank_3)
itemBinding.ivCrown.visibility = View.VISIBLE
}
@@ -188,6 +226,18 @@ data class LiveRoomDonationChat(
) : LiveRoomChat() {
override fun bind(context: Context, binding: ViewBinding, onClickProfile: ((Long) -> Unit)?) {
val itemBinding = binding as ItemLiveRoomChatBinding
val defaultProfileSize = 33.3f.dpToPx().toInt()
val defaultCrownSize = 16.7f.dpToPx().toInt()
itemBinding.flProfile.layoutParams = itemBinding.flProfile.layoutParams.apply {
width = defaultProfileSize
height = defaultProfileSize
}
itemBinding.ivCrown.layoutParams = itemBinding.ivCrown.layoutParams.apply {
width = defaultCrownSize
height = defaultCrownSize
}
val donationText = context.getString(
if (isSecret) {
R.string.screen_live_room_secret_mission_sent
@@ -307,6 +357,18 @@ data class LiveRoomRouletteDonationChat(
) : LiveRoomChat() {
override fun bind(context: Context, binding: ViewBinding, onClickProfile: ((Long) -> Unit)?) {
val itemBinding = binding as ItemLiveRoomChatBinding
val defaultProfileSize = 33.3f.dpToPx().toInt()
val defaultCrownSize = 16.7f.dpToPx().toInt()
itemBinding.flProfile.layoutParams = itemBinding.flProfile.layoutParams.apply {
width = defaultProfileSize
height = defaultProfileSize
}
itemBinding.ivCrown.layoutParams = itemBinding.ivCrown.layoutParams.apply {
width = defaultCrownSize
height = defaultCrownSize
}
val chat = context.getString(
R.string.screen_live_room_roulette_win,
rouletteResult