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

View File

@@ -0,0 +1,84 @@
# 20260318_라이브룸채팅왕관표시수정.md
## 개요
- 라이브룸 일반 채팅(`LiveRoomNormalChat`)의 랭킹 왕관 표시를 요청사항에 맞게 수정한다.
## 작업 내용
- [x] 기존 랭킹 분기(`-2`, `-1`, `1`, `2`, `3`) 및 레이아웃 구조 확인
- [x] `item_live_room_chat.xml`에서 왕관 parent/자식 크기 제어 구조 반영
- [x] `LiveRoomChat.kt`에서 `1`, `2`, `3`위 왕관 리소스/배경 처리 로직 반영
- [x] `-2`, `-1` 표시 및 크기 유지 확인
- [x] 검증 수행 (`lsp_diagnostics`, `./gradlew :app:testDebugUnitTest`, `./gradlew :app:assembleDebug`)
- [x] 사용자 피드백 반영: `fl_crown` 제거 후 `fl_profile`/`iv_crown` 직접 크기 조절로 재수정
- [x] `1`, `2`, `3`위에서만 `iv_crown=match_parent`, `fl_profile=39x38dp` 적용 및 나머지 기본 크기 유지
## 검증 기록
- 무엇을: 라이브룸 일반 채팅의 랭킹 왕관 표시에서 `1`, `2`, `3`위 리소스를 `img_rank_1~3`로 변경하고, 해당 경우에만 왕관 parent 크기를 `39dp x 38dp`로 적용
- 왜: 상위 3위 왕관 표시 규격을 신규 디자인 리소스에 맞추고, `-2`, `-1` 표시 크기는 기존과 동일하게 유지하기 위함
- 어떻게:
- `item_live_room_chat.xml``iv_crown` 전용 parent(`fl_crown`)를 추가하고 `iv_crown``match_parent`로 변경
- `LiveRoomChat.kt`에서 기본 왕관 parent 크기를 `16.7dp`로 초기화 후, `1`, `2`, `3`위에서만 `39dp x 38dp`로 변경
- `1`, `2`, `3`위에서는 `iv_bg``null` 처리하고 `img_rank_1`, `img_rank_2`, `img_rank_3`를 사용
- `-2`, `-1` 분기의 왕관/배경 리소스는 기존 로직을 유지
- `lsp_diagnostics` 실행(현재 환경 `.kt`, `.xml` LSP 미구성), Gradle 테스트/빌드 검증 수행
- 실행 명령:
- `lsp_diagnostics filePath=app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt`
- `lsp_diagnostics filePath=app/src/main/res/layout/item_live_room_chat.xml`
- `./gradlew :app:testDebugUnitTest`
- `./gradlew :app:assembleDebug`
- 결과:
- `app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt` 반영 완료
- `app/src/main/res/layout/item_live_room_chat.xml` 반영 완료
- `./gradlew :app:testDebugUnitTest` 성공
- `./gradlew :app:assembleDebug` 성공
- LSP 진단은 `.kt`, `.xml` 서버 미설정으로 미실행(Gradle 검증으로 대체)
### 추가 검증 (lint)
- 무엇을: 변경 영향 확인을 위해 `:app:lintDebug` 추가 실행
- 왜: XML/Kotlin 수정 후 정적 분석 경고/오류 여부를 확인하기 위함
- 실행 명령:
- `./gradlew :app:lintDebug`
- 결과:
- 실패(기존 이슈): `AndroidManifest.xml``com.facebook.FacebookActivity` MissingClass 포함 기존 lint 오류 21건, 경고 593건
- 이번 변경 파일(`LiveRoomChat.kt`, `item_live_room_chat.xml`) 직접 오류는 로그상 확인되지 않음
### 추가 수정 (요청 반영: fl_profile/iv_crown 직접 조절)
- 무엇을: `fl_crown` 방식 대신 `fl_profile``iv_crown`의 크기를 직접 제어하도록 변경
- 왜: 왕관 전용 container가 프로필 container보다 커져 표시가 깨질 수 있는 문제를 방지하기 위함
- 어떻게:
- `item_live_room_chat.xml`에서 `fl_crown`을 제거하고 `iv_crown``fl_profile` 직계 자식으로 복원
- `LiveRoomChat.kt`에서 `LiveRoomNormalChat` 바인딩 시 기본값을 `fl_profile=33.3dp`, `iv_crown=16.7dp`로 초기화
- `1`, `2`, `3`위일 때만 `fl_profile=39x38dp`, `iv_crown=match_parent`로 변경하고 `img_rank_1~3` 적용
- `-2`, `-1`, 그 외 분기는 기본 크기를 유지
- 뷰 재활용 영향 방지를 위해 `LiveRoomDonationChat`, `LiveRoomRouletteDonationChat`에서도 기본 크기 초기화 추가
- 실행 명령:
- `lsp_diagnostics filePath=app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt`
- `lsp_diagnostics filePath=app/src/main/res/layout/item_live_room_chat.xml`
- `./gradlew :app:testDebugUnitTest`
- `./gradlew :app:assembleDebug`
- 결과:
- `app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt` 재반영 완료
- `app/src/main/res/layout/item_live_room_chat.xml` 재반영 완료
- `LiveRoomDonationChat`, `LiveRoomRouletteDonationChat`의 기본 크기 초기화 반영 완료
### 재검증 결과 (요청 반영 후)
- 실행 명령:
- `lsp_diagnostics filePath=app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt`
- `lsp_diagnostics filePath=app/src/main/res/layout/item_live_room_chat.xml`
- `./gradlew :app:testDebugUnitTest`
- `./gradlew :app:assembleDebug`
- 결과:
- `lsp_diagnostics`는 현재 환경 `.kt`, `.xml` 서버 미설정으로 미실행
- `./gradlew :app:testDebugUnitTest` 성공
- `./gradlew :app:assembleDebug` 성공
### 최종 재검증
- 실행 명령:
- `lsp_diagnostics filePath=app/src/main/java/kr/co/vividnext/sodalive/live/room/chat/LiveRoomChat.kt`
- `lsp_diagnostics filePath=app/src/main/res/layout/item_live_room_chat.xml`
- `./gradlew :app:testDebugUnitTest`
- `./gradlew :app:assembleDebug`
- 결과:
- `lsp_diagnostics`는 현재 환경 `.kt`, `.xml` 서버 미설정으로 미실행
- `./gradlew :app:testDebugUnitTest` 성공(UP-TO-DATE 포함)
- `./gradlew :app:assembleDebug` 성공(UP-TO-DATE 포함)