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() }