fix(deeplink): 예약 라이브 딥링크 라우팅을 메인으로 통일한다
This commit is contained in:
@@ -929,7 +929,7 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
||||
}
|
||||
|
||||
viewModel.getRoomDetail(roomId) {
|
||||
if (it.channelName != null) {
|
||||
if (!it.channelName.isNullOrBlank()) {
|
||||
if (it.manager.id == SharedPreferenceManager.userId) {
|
||||
handler.postDelayed({
|
||||
viewModel.enterRoom(roomId, onEnterRoomSuccess)
|
||||
|
||||
@@ -231,11 +231,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
|
||||
when {
|
||||
roomId != null && roomId > 0 -> {
|
||||
startActivity(
|
||||
Intent(applicationContext, LiveRoomActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_ROOM_ID, roomId)
|
||||
}
|
||||
)
|
||||
routeLiveInMain(roomId)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -332,11 +328,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
return false
|
||||
}
|
||||
|
||||
startActivity(
|
||||
Intent(applicationContext, LiveRoomActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_ROOM_ID, deepLinkValueId)
|
||||
}
|
||||
)
|
||||
routeLiveInMain(deepLinkValueId)
|
||||
true
|
||||
}
|
||||
|
||||
@@ -424,4 +416,19 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun routeLiveInMain(roomId: Long) {
|
||||
val extras = Bundle().apply {
|
||||
putString("room_id", roomId.toString())
|
||||
putString("deep_link_value", "live")
|
||||
putString("deep_link_sub5", roomId.toString())
|
||||
}
|
||||
|
||||
startActivity(
|
||||
Intent(applicationContext, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
putExtra(Constants.EXTRA_DATA, extras)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,11 +317,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
|
||||
val deepLinkUrl = bundle.getString("deep_link")
|
||||
if (!deepLinkUrl.isNullOrBlank()) {
|
||||
val deepLinkBundle = buildBundleFromDeepLinkUrl(deepLinkUrl)
|
||||
if (deepLinkBundle != null) {
|
||||
return executeBundleRoute(deepLinkBundle)
|
||||
}
|
||||
|
||||
return false
|
||||
return executeBundleRoute(deepLinkBundle ?: bundle)
|
||||
}
|
||||
|
||||
return executeBundleRoute(bundle)
|
||||
@@ -340,18 +336,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
|
||||
?: bundle.getLong(Constants.EXTRA_AUDITION_ID).takeIf { it > 0 }
|
||||
val communityCreatorId = bundle.getString(Constants.EXTRA_COMMUNITY_CREATOR_ID)?.toLongOrNull()
|
||||
?: bundle.getLong(Constants.EXTRA_COMMUNITY_CREATOR_ID).takeIf { it > 0 }
|
||||
val isLiveReservation = bundle.getBoolean(Constants.EXTRA_LIVE_RESERVATION_RESPONSE)
|
||||
|
||||
when {
|
||||
roomId != null && roomId > 0 -> {
|
||||
viewModel.clickTab(MainViewModel.CurrentTab.LIVE)
|
||||
|
||||
handler.postDelayed({
|
||||
if (isLiveReservation) {
|
||||
liveFragment.reservationRoom(roomId)
|
||||
} else {
|
||||
liveFragment.enterLiveRoom(roomId)
|
||||
}
|
||||
liveFragment.enterLiveRoom(roomId)
|
||||
}, 500)
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user