From 43c112eb25ea28980cd8b1efab7e6191396f6336 Mon Sep 17 00:00:00 2001 From: klaus Date: Fri, 6 Mar 2026 16:55:56 +0900 Subject: [PATCH] =?UTF-8?q?fix(liveroom):=20=EB=94=A5=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=20=EC=95=88=EB=82=B4=20=EB=AC=B8=EA=B5=AC?= =?UTF-8?q?=EB=A5=BC=20=EB=8B=A8=EC=88=9C=ED=99=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/live/room/LiveRoomActivity.kt | 91 +------------------ app/src/main/res/values-en/strings.xml | 11 +-- app/src/main/res/values-ja/strings.xml | 11 +-- app/src/main/res/values/strings.xml | 11 +-- 4 files changed, 10 insertions(+), 114 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 f6f24512..1576f6a2 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 @@ -22,7 +22,6 @@ import android.graphics.Path import android.graphics.Rect import android.graphics.Typeface import android.graphics.drawable.Drawable -import android.net.Uri import android.os.Build import android.os.Bundle import android.os.CountDownTimer @@ -124,7 +123,6 @@ import kr.co.vividnext.sodalive.settings.language.LanguageManager import kr.co.vividnext.sodalive.settings.notification.MemberRole import org.koin.android.ext.android.inject import org.json.JSONObject -import java.util.Locale import java.util.concurrent.TimeUnit import java.util.regex.Pattern import kotlin.random.Random @@ -254,9 +252,8 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private val deepLinkConfirmReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { val bundle = intent?.getBundleExtra(Constants.EXTRA_DATA) ?: return - val destinationPageName = resolveDestinationPageName(bundle) - showDeepLinkNavigationDialog(destinationPageName) { + showDeepLinkNavigationDialog { val nextIntent = Intent(applicationContext, MainActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) putExtra(Constants.EXTRA_DATA, bundle) @@ -1227,10 +1224,7 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB private fun handleNoticeUrlClick(url: String) { val viewIntent = Intent(Intent.ACTION_VIEW, url.toUri()) if (isInAppDeepLinkIntent(viewIntent)) { - val deepLinkExtras = buildDeepLinkExtrasFromUri(viewIntent.data) - val destinationPageName = resolveDestinationPageName(deepLinkExtras) - - showDeepLinkNavigationDialog(destinationPageName) { + showDeepLinkNavigationDialog { startActivity(viewIntent) finish() } @@ -1261,89 +1255,12 @@ class LiveRoomActivity : BaseActivity(ActivityLiveRoomB } } - private fun buildDeepLinkExtrasFromUri(data: Uri?): Bundle { - val extras = Bundle() - if (data == null) { - return extras - } - - fun putQuery(key: String) { - val value = data.getQueryParameter(key) - if (!value.isNullOrBlank()) { - extras.putString(key, value) - } - } - - putQuery("room_id") - putQuery("channel_id") - putQuery("message_id") - putQuery("audition_id") - putQuery("content_id") - putQuery("deep_link_value") - putQuery("deep_link_sub5") - - val deepLinkValue = extras.getString("deep_link_value") - val deepLinkValueId = extras.getString("deep_link_sub5") - - if (!deepLinkValue.isNullOrBlank() && !deepLinkValueId.isNullOrBlank()) { - when (deepLinkValue.lowercase(Locale.ROOT)) { - "live" -> if (!extras.containsKey("room_id")) { - extras.putString("room_id", deepLinkValueId) - } - - "channel" -> if (!extras.containsKey("channel_id")) { - extras.putString("channel_id", deepLinkValueId) - } - - "content" -> if (!extras.containsKey("content_id")) { - extras.putString("content_id", deepLinkValueId) - } - - "audition" -> if (!extras.containsKey("audition_id")) { - extras.putString("audition_id", deepLinkValueId) - } - - else -> Unit - } - } - - return extras - } - - private fun resolveDestinationPageName(bundle: Bundle): String { - val roomId = bundle.getString("room_id")?.toLongOrNull() - ?: bundle.getLong(Constants.EXTRA_ROOM_ID).takeIf { it > 0 } - val channelId = bundle.getString("channel_id")?.toLongOrNull() - ?: bundle.getLong(Constants.EXTRA_USER_ID).takeIf { it > 0 } - val messageId = bundle.getString("message_id")?.toLongOrNull() - ?: bundle.getLong(Constants.EXTRA_MESSAGE_ID).takeIf { it > 0 } - val contentId = bundle.getString("content_id")?.toLongOrNull() - ?: bundle.getLong(Constants.EXTRA_AUDIO_CONTENT_ID).takeIf { it > 0 } - - return when { - roomId != null && roomId > 0 -> getString(R.string.screen_live_room_deeplink_target_live_room) - channelId != null && channelId > 0 -> getString(R.string.screen_live_room_deeplink_target_channel_profile) - contentId != null && contentId > 0 -> getString(R.string.screen_live_room_deeplink_target_content_detail) - messageId != null && messageId > 0 -> getString(R.string.screen_live_room_deeplink_target_message) - else -> { - when (bundle.getString("deep_link_value")?.lowercase(Locale.ROOT)) { - "live" -> getString(R.string.screen_live_room_deeplink_target_live_room) - "channel" -> getString(R.string.screen_live_room_deeplink_target_channel_profile) - "content" -> getString(R.string.screen_live_room_deeplink_target_content_detail) - "series" -> getString(R.string.screen_live_room_deeplink_target_series_detail) - "audition" -> getString(R.string.screen_live_room_deeplink_target_audition) - else -> getString(R.string.screen_live_room_deeplink_target_default) - } - } - } - } - - private fun showDeepLinkNavigationDialog(destinationPageName: String, onConfirm: () -> Unit) { + private fun showDeepLinkNavigationDialog(onConfirm: () -> Unit) { SodaDialog( activity = this, layoutInflater = layoutInflater, title = getString(R.string.screen_live_room_deeplink_move_title), - desc = getString(R.string.screen_live_room_deeplink_move_message, destinationPageName), + desc = getString(R.string.screen_live_room_deeplink_move_message), confirmButtonTitle = getString(R.string.screen_live_room_yes), confirmButtonClick = { onConfirm() diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index da739512..dd19be14 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -429,15 +429,8 @@ End this live?\nChat history will not be saved and will disappear.\nParticipants will also be removed when the live ends. Leave live Leave this live room? - Open deep link - Close this page and move to %1$s? - Live room page - Channel profile page - Content detail page - Message page - Series detail page - Audition page - requested page + Notification + If you move to another page, you will leave the current live. Yes No Speaker request sent.\nwait a moment. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 2e75ddc9..cda567c9 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -428,15 +428,8 @@ ライブを終了しますか?\n終了するとチャット内容は保存されず消えます。\nリスナーもライブ終了と共に\n強制退出となります。 ライブ退出 ライブから退出しますか? - ディープリンク移動 - 現在のページを終了して%1$sへ移動しますか? - ライブルームページ - チャンネルプロフィールページ - コンテンツ詳細ページ - メッセージページ - シリーズ詳細ページ - オーディションページ - リクエストされたページ + 通知 + 他のページに移動すると、現在のライブから退出します。 はい いいえ スピーカーリクエストを送りました。\n少々お待ちください。 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fdb95cdb..68922c01 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -428,15 +428,8 @@ 라이브를 종료하시겠습니까?\n라이브를 종료하면 대화내용은\n저장되지 않고 사라집니다.\n참여자들 또한 라이브가 종료되어\n강제퇴장 됩니다. 라이브 나가기 라이브에서 나가시겠습니까? - 딥링크 이동 - 현재 페이지를 종료하고 %1$s로 이동하시겠습니까? - 라이브룸 페이지 - 채널 프로필 페이지 - 콘텐츠 상세 페이지 - 메시지 페이지 - 시리즈 상세 페이지 - 오디션 페이지 - 요청한 페이지 + 알림 + 다른 페이지로 이동시 현재 라이브에서 나가게 됩니다. 아니오 스피커 요청을 보냈습니다.\n잠시만 기다려 주세요.