-
Notifications
You must be signed in to change notification settings - Fork 1
[REFACTOR] 네비게이션의 sealed class 기반 경로를 KClass 기반으로 리팩토링 #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9d55152
[REMOVE/#212] 사용하지 않는 TopDestination, 네비게이션 바 제거
DongChyeon a964be0
[REFACTOR/#212] KClass 기반 네비게이션을 위해 라우트를 @Serializable 기반으로 관리하도록 변경
DongChyeon 5fa74fd
[REFACTOR/#212] KClass 기반 라우팅 적용
DongChyeon 34fd208
[REFACTOR/#212] 공통 navigateTo 함수 제거 및 각 Route 별 명시적 라우팅 함수 분리
DongChyeon cd72e29
[REFACTOR/#212] Onboarding 단계 이동 시 currentRoute 파싱 대신 명시적 currentStep…
DongChyeon 525b14b
[FIX/#212] updateBirthDate 반영 오류 수정
DongChyeon ee90f2c
[REFACTOR/#212] 온보딩 단계 이동 함수 네이밍 개선 및 null 안전 처리 추가
DongChyeon 868fb8d
[RENAME/#212] 파일 이름 수정
DongChyeon 4cd446c
[REMOVE/#212] 안 쓰는 함수 제거
DongChyeon 8a297e7
[REFACTOR/#212] GSON -> kotlinx.serialization 마이그레이션
DongChyeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
core/common/src/main/java/com/yapp/common/navigation/extensions/RouteExtension.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.yapp.common.navigation.extensions | ||
|
|
||
| import kotlin.reflect.KClass | ||
|
|
||
| fun <T : Any> KClass<T>.toRoute(): String = this.simpleName ?: error("Route name missing") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,14 +16,13 @@ import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.navigationBarsPadding | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.runtime.DisposableEffect | ||
| import androidx.compose.runtime.LaunchedEffect | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.core.util.Consumer | ||
| import androidx.navigation.compose.NavHost | ||
| import com.yapp.alarm.AlarmConstants | ||
| import com.yapp.alarm.receivers.AlarmInteractionActivityReceiver | ||
| import com.yapp.common.navigation.destination.AlarmInteractionDestination | ||
| import com.yapp.common.navigation.rememberOrbitNavigator | ||
| import com.yapp.common.navigation.route.AlarmInteractionBaseRoute | ||
| import com.yapp.designsystem.theme.OrbitTheme | ||
| import com.yapp.domain.model.Alarm | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
|
|
@@ -70,11 +69,12 @@ class AlarmInteractionActivity : ComponentActivity() { | |
| ) { | ||
| NavHost( | ||
| navController = navigator.navController, | ||
| startDestination = AlarmInteractionDestination.Route.route, | ||
| startDestination = AlarmInteractionBaseRoute, | ||
| modifier = Modifier.navigationBarsPadding(), | ||
| ) { | ||
| alarmInteractionNavGraph( | ||
| navigator = navigator, | ||
| alarm = alarm, | ||
| ) | ||
| } | ||
| } | ||
|
|
@@ -89,7 +89,7 @@ class AlarmInteractionActivity : ComponentActivity() { | |
| } | ||
| Log.d("AlarmInteractionActivity", "New Intent: $newIntent") | ||
| newAlarm?.let { alarm -> | ||
| navigator.navController.navigate("${AlarmInteractionDestination.AlarmAction.route}/$alarm") | ||
| navigator.navigateToAlarmAction(alarm = alarm) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -99,13 +99,6 @@ class AlarmInteractionActivity : ComponentActivity() { | |
| [email protected](onNewIntentConsumer) | ||
| } | ||
| } | ||
|
|
||
| LaunchedEffect(Unit) { | ||
| val route = "${AlarmInteractionDestination.AlarmAction.route}/$alarm" | ||
| navigator.navController.navigate(route) { | ||
| popUpTo(AlarmInteractionDestination.Route.route) { inclusive = true } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.