From ddc7b9a76ff7f61036237814fc24a84fe9bab952 Mon Sep 17 00:00:00 2001 From: klaus Date: Tue, 2 Dec 2025 20:39:03 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=EB=A3=B8=20?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=20=ED=8F=AC=EB=A7=B7=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EB=B6=88=ED=95=84=EC=9A=94=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기부/비밀미션 전송 메시지의 포맷 타입을 문자열로 통일. 사용되지 않는 변수 정리 및 import 정리. --- .../sodalive/live/room/LiveRoomActivity.kt | 76 +++++++++---------- 1 file changed, 35 insertions(+), 41 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 8af53873..99760d0f 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 @@ -2,8 +2,8 @@ package kr.co.vividnext.sodalive.live.room import android.animation.Animator import android.animation.AnimatorListenerAdapter -import android.animation.ObjectAnimator import android.animation.ValueAnimator +import android.animation.ObjectAnimator import android.annotation.SuppressLint import android.app.AlertDialog import android.content.ClipData @@ -1370,9 +1370,9 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private fun donation(can: Int, message: String, isSecret: Boolean) { val rawMessage = if (isSecret) { - getString(R.string.screen_live_room_secret_mission_sent, can) + getString(R.string.screen_live_room_secret_mission_sent, can.toString()) } else { - getString(R.string.screen_live_room_donation_sent, can) + getString(R.string.screen_live_room_donation_sent, can.toString()) } viewModel.donation(roomId, can, message, isSecret) { signature -> @@ -2443,13 +2443,11 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB val dm = resources.displayMetrics val fallbackW = if (rw > 0) rw else dm.widthPixels val fallbackH = if (rh > 0) rh else dm.heightPixels - val minX = margin - val maxX = (fallbackW.toFloat() - margin).coerceAtLeast(minX + 1f) - val minY = margin - val maxY = (fallbackH.toFloat() - margin).coerceAtLeast(minY + 1f) + val maxX = (fallbackW.toFloat() - margin).coerceAtLeast(margin + 1f) + val maxY = (fallbackH.toFloat() - margin).coerceAtLeast(margin + 1f) - fun randomX(): Float = minX + Random.nextFloat() * (maxX - minX) - fun randomY(): Float = minY + Random.nextFloat() * (maxY - minY) + fun randomX(): Float = margin + Random.nextFloat() * (maxX - margin) + fun randomY(): Float = margin + Random.nextFloat() * (maxY - margin) // 0: 중앙, 1..4: 랜덤 위치 repeat(totalExplosions) { index -> @@ -2505,17 +2503,17 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private val baseHeartPath: Path = Path().apply { // Swift HeartShape와 동일한 하트 경로 (정규화 좌표 [-1,1]에 0.9 스케일 반영) reset() - val S = 0.9f - moveTo(0f, -0.45f * S) + val s = 0.9f + moveTo(0f, -0.45f * s) cubicTo( - 0.62f * S, -1.02f * S, - 1.22f * S, -0.04f * S, - 0f, 0.65f * S + 0.62f * s, -1.02f * s, + 1.22f * s, -0.04f * s, + 0f, 0.65f * s ) cubicTo( - -1.22f * S, -0.04f * S, - -0.62f * S, -1.02f * S, - 0f, -0.45f * S + -1.22f * s, -0.04f * s, + -0.62f * s, -1.02f * s, + 0f, -0.45f * s ) close() } @@ -2528,8 +2526,6 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private var explosionAnimator: ValueAnimator? = null private val explosionDurationMs = 900L private val gravity = 1400f // px/s^2 - private var explosionCenterX = 0f - private var explosionCenterY = 0f // 화면 중앙에 하트를 잠깐 표시 후 자동 폭발 fun emitCenterOnce(sizeDp: Float = 200f, showDurationMs: Long = 500L) { @@ -2613,13 +2609,11 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB val dm = resources.displayMetrics val fallbackW = if (rw > 0) rw else dm.widthPixels val fallbackH = if (rh > 0) rh else dm.heightPixels - val minX = margin - val maxX = (fallbackW.toFloat() - margin).coerceAtLeast(minX + 1f) - val minY = margin - val maxY = (fallbackH.toFloat() - margin).coerceAtLeast(minY + 1f) + val maxX = (fallbackW.toFloat() - margin).coerceAtLeast(margin + 1f) + val maxY = (fallbackH.toFloat() - margin).coerceAtLeast(margin + 1f) - fun randomX(): Float = minX + Random.nextFloat() * (maxX - minX) - fun randomY(): Float = minY + Random.nextFloat() * (maxY - minY) + fun randomX(): Float = margin + Random.nextFloat() * (maxX - margin) + fun randomY(): Float = margin + Random.nextFloat() * (maxY - margin) // 0: 중앙, 1..6: 랜덤 위치 repeat(totalExplosions) { index -> @@ -2695,17 +2689,17 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private val baseHeartPath: Path = Path().apply { // Swift HeartShape와 동일한 하트 경로 (정규화 좌표 [-1,1]에 0.9 스케일 반영) reset() - val S = 0.9f - moveTo(0f, -0.45f * S) + val s = 0.9f + moveTo(0f, -0.45f * s) cubicTo( - 0.62f * S, -1.02f * S, - 1.22f * S, -0.04f * S, - 0f, 0.65f * S + 0.62f * s, -1.02f * s, + 1.22f * s, -0.04f * s, + 0f, 0.65f * s ) cubicTo( - -1.22f * S, -0.04f * S, - -0.62f * S, -1.02f * S, - 0f, -0.45f * S + -1.22f * s, -0.04f * s, + -0.62f * s, -1.02f * s, + 0f, -0.45f * s ) close() } @@ -2809,17 +2803,17 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private val baseHeartPath: Path = Path().apply { // Swift HeartShape와 동일한 하트 경로 (정규화 좌표 [-1,1]에 0.9 스케일 반영) reset() - val S = 0.9f - moveTo(0f, -0.45f * S) + val s = 0.9f + moveTo(0f, -0.45f * s) cubicTo( - 0.62f * S, -1.02f * S, - 1.22f * S, -0.04f * S, - 0f, 0.65f * S + 0.62f * s, -1.02f * s, + 1.22f * s, -0.04f * s, + 0f, 0.65f * s ) cubicTo( - -1.22f * S, -0.04f * S, - -0.62f * S, -1.02f * S, - 0f, -0.45f * S + -1.22f * s, -0.04f * s, + -0.62f * s, -1.02f * s, + 0f, -0.45f * s ) close() }