-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] 홈 모듈 생성 및 홈-프로필 네비게이션 연결 (#29)
* [build] : AndroidHiltPlugin에 hilt-navigation-compose 라이브러리 추가 * [feat] : Home, Profile 네비게이션 연결 * [build] : profile 모듈 :designsystem 추가 * [chore] : reformat * [refactor] : 네비게이션 homeGraph 제거 및 homeScreen으로 변경 * [refactor] : Profile sealed class 이름 ProfileScreens로 변경
- Loading branch information
Showing
21 changed files
with
599 additions
and
357 deletions.
There are no files selected for viewing
This file contains 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 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
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/moya/funch/navigation/FunchNavHost.kt
This file contains 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,30 @@ | ||
package com.moya.funch.navigation | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NavHostController | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.rememberNavController | ||
|
||
@Composable | ||
fun FunchNavHost( | ||
hasProfile: Boolean, | ||
navController: NavHostController = rememberNavController(), | ||
) { | ||
NavHost( | ||
navController = navController, | ||
startDestination = determineStartDestination(hasProfile), | ||
) { | ||
profileGraph( | ||
onNavigateToHome = navController::navigateToHome, | ||
onCloseMyProfile = navController::closeMyProfile, | ||
) | ||
homeScreen( | ||
onNavigateToMatching = { /* @Gun Hyung TODO : 매칭 라우터 연결 */ }, | ||
onNavigateToMyProfile = navController::navigateToMyProfile, | ||
) | ||
} | ||
} | ||
|
||
private fun determineStartDestination(hasProfile: Boolean): String { | ||
return if (hasProfile) HOME_ROUTE else PROFILE_GRAPH_ROUTE | ||
} |
Oops, something went wrong.