-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Fix/#7] fix project setting #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค๋น๊ฒ์ด์ ์ ๋ง ๊ณ ์ ๋ง์์ต๋๋ค!! ์ธ์ ๋๊ฒจ์ฃผ๋ ์ฝ๋๋ ํ๋ฒ ์ค๋ช ํด์ฃผ์๋ฉด ๊ฐ์ฌํ๋๋ฆฝ๋๋ค..ใ
fun NavController.navigationOnboarding2(navOptions: NavOptions? = null) { | ||
navigate("OnboardingScreen2", navOptions) | ||
} | ||
|
||
fun NavGraphBuilder.onboardingNavGraph( | ||
navigateToOnboardingScreen2: () -> Unit, | ||
navigateToMainScreen: () -> Unit, | ||
) { | ||
composable("OnboardingScreen1") { | ||
OnboardingScreen1(navigateToOnboardingScreen2 = navigateToOnboardingScreen2) | ||
} | ||
composable("OnboardingScreen2") { | ||
OnboardingScreen2(navigateToMainScreen = navigateToMainScreen) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3 : ์ค๋ช ํ์ ๊ฒ ์๋ฒฝํ ์ดํดํ์ต๋๋ค!!
fun NavController.navigationTodo(navOptions: NavOptions) { | ||
navigate( | ||
route = MainNavigationBarRoute.Todo::class.simpleName.orEmpty(), | ||
navOptions = navOptions, | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3 : simplename์ด ํด๋์ค์ ๋์ ์ด๋ฆ์ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ด๊ตฐ์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋๋ฌด ๋๋ฌด ๊ณ ์ ๋ง์์ด์ ์ธ๋ ์ต๊ณ ์ผ ์ง์ง!!! ๐ค๐ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3 : ๋ค์ด์ค ์จ๋ณด๋ฉ ์์๋ฅผ ์ ํ์ฉํด ๋ณผ๊ฒ์!! ๐
private val currentDestination: NavDestination? | ||
@Composable get() = navHostController.currentBackStackEntryAsState().value?.destination | ||
|
||
val startDestination = "OnboardingScreen1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3 : ์์ํ ํ์ํ์ง ๊ถ๊ธํด์ !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค! ์ ๊ฐ ๊ทธ๋ฅ ์ง๊ธ ๋ง ์ง๋๋๊ณ ์ด๋ ๊ฒ ๋๋๋ฐ ์ฌ์ค์ ํ๋ฉด ์ข์ฃ ..
์ ์๊ฐ์ ๋ฃจํธ๋ ๋ชจ๋ ์์ํ์ํค๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
โฆID-MEMENTO into fix/#7-fix-project-setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ณ ์ํ์
จ์ต๋๋ค!
๋ฆฌ๋ทฐ ์ฝ์ด๋ณด์๊ณ ์ง๋ฌธ ์์ผ๋ฉด ์ธ์ ๋ ํด์ฃผ์
์!
navigationBarItems = BottomNavigationType.entries, | ||
currentNavigationBarItem = navigator.currentMainNavigationBarItem, | ||
onNavigationBarItemSelected = { navigator.navigateMainNavigation(it) }, | ||
onAddButtonClick = { navigator.navigateToBottomSheet() }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐํ
์ํธ๋ navigator๋ก ๊ด๋ฆฌํ ์ด์ ๊ฐ ๊ถ๊ธํด์!
์ ๋ navigator๊ฐ ์ฑ ๋ด์ ์๋ก ๋ค๋ฅธ ํ๋ฉด ๊ฐ์ ์ด๋์ ๋ํ ๋ก์ง์ ์ฑ
์์ง๋ค๊ณ ์๊ฐํด์.
๋ฐํ
์ํธ๊ฐ ๋ํ๋๋ ๊ฒ์ ์๋ก ๋ค๋ฅธ ํ๋ฉด ๊ฐ์ ์ด๋์ด ์๋ ํ ํ๋ฉด ๋ด์์ ์ถ๊ฐ์ ์ธ ์ ๋ณด๋ฅผ ์ป๊ธฐ ์ํด UI ์์๋ฅผ ๋ํ๋๊ฒ ํ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ navigator๋ก ๊ด๋ฆฌํ๋ ๊ฒ๋ณด๋ค๋ ๊ฐ ํ๋ฉด์ ์ํ๋ฅผ ๋ณ๊ฒฝ ์ํค๋ ๋ฐฉ์์ผ๋ก ๊ตฌํํ๋ ๊ฒ์ด ์ด๋จ๊น ์ถ๋ค์!
fun navigateToOnboarding2() { | ||
navHostController.navigationOnboarding2() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack ๊ด๋ฆฌ๋ฅผ ์ํด popBackStack ํจ์๋ค์ ๋ฏธ๋ฆฌ ์ถ๊ฐํด๋์ด๋ ์ข์ ๊ฒ ๊ฐ์์ !
|
||
@Composable | ||
fun CustomNavigationBarItem( | ||
context: Context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ์ฉ๋์ง ์๋ ์ธ์๊ฐ์์!
ํ์ธ ํ ์ง์์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ๋ค์ ~
bottomNavigationType.label?.let { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ฑฐ ์์ด๋ ๋ ๊ฒ ๊ฐ์๋ฐ!
๋ง์ฐฌ๊ฐ์ง๋ก ํ์ธ ํ ์์ ํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์ ~
CustomNavigationBarItem( | ||
context = context, | ||
bottomNavigationType = navigationBarItems[0], | ||
isSelected = currentNavigationBarItem == navigationBarItems[0], | ||
onClick = { onNavigationBarItemSelected(navigationBarItems[0]) }, | ||
modifier = Modifier.weight(1f), | ||
) | ||
|
||
Box( | ||
modifier = | ||
Modifier | ||
.size(48.dp) | ||
.background(Color.LightGray, shape = RoundedCornerShape(24.dp)) | ||
.clickable { onAddButtonClick() }, | ||
contentAlignment = Alignment.Center, | ||
) { | ||
Icon( | ||
painter = painterResource(id = R.drawable.add_white_24), | ||
contentDescription = "Add Button", | ||
tint = Color.White, | ||
) | ||
} | ||
|
||
CustomNavigationBarItem( | ||
context = context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๋ถ๋ถ ์กฐ๊ธ ๋ ํ์ฅ์ฑ์๊ฒ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๊ณ ๋ฏผํด๋ด๋ ์ข์ ๊ฒ ๊ฐ์์!
์ง๊ธ ์๊ฐ๋๋ ๋ฐฉ๋ฒ์,,,
- ์ค๊ฐ + ๋ฒํผ๊น์ง navigationBarItems์ ๋ฃ๊ธฐ
- navigationBarItems enum ๋ด๋ถ์ ๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ํ ์ ์๋ ๊ฐ ๋ฃ๊ธฐ
- ์ถ๊ฐ ํ ๊ฐ์ผ๋ก ๋ถ๊ธฐ์ฒ๋ฆฌ ํ์ฌ ๋ค๋ฅธ UI ๋ฐ ๋ก์ง ์คํํ๊ธฐ
๊ณ ๋ฏผํด๋ณด์๊ณ ์ถํ์๋ผ๋ ๋ฆฌํฉํ ๋ง ํด๋ณด๋ฉด ํจ์จ์ ์ธ ์ฝ๋๊ฐ ๋ ๊ฒ ๊ฐ์ต๋๋ค! (์ถํ ๋ฐํ ๋ค๋น์ ์์๊ฐ ๋์ด๋๋ ๊ฒฝ์ฐ๋ ์ ๋ง ๋ง๊ธฐ์ ๋ณํ์ ์ ์ฐํ๊ฒ ๋์ฒํ ์ ์๋๋ก !!)
modifier: Modifier = Modifier, | ||
navigator: MainNavigator, | ||
padding: PaddingValues, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๊ฑฐ ์์ ๋ง์ถฐ์ค์๋ค!!
ํ์ ์ธ์ > Modifier > ์ ํ ์ธ์ ์์ !!
) | ||
|
||
todayNavGraph( | ||
navigateToReqres = { navigator.navigateToReqres() }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:: (๋๋ธ์ฝ๋ก )์ ํตํด์ ์์ฑํ ์๋ ์์ด์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋์ค์ ์ธ๋ฏธ๋ ๋ ๋ค๋ค๋ ๊ฒ์ฒ๋ผ TypeSafetyํ ๋ฐฉ๋ฒ์ ์ฌ์ฉํด ๋ณด์๋ ์ข์ ๊ฒ ๊ฐ์์.
import androidx.compose.ui.graphics.Color | ||
|
||
@Composable | ||
fun OnboardingScreen1(navigateToOnboardingScreen2: () -> Unit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnboardingScreen์ 2๊ฐ๋ฅผ ๋ง๋์ ์ด์ ๊ฐ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI๋ฅผ ๋ณด์ง ์์์ ์ ๋ชจ๋ฅด๊ฒ ์ง๋ง pager ๋ฑ์ผ๋ก ์ด๋ํ๋ ๊ฒ์ด ํ์ํ ํ๋ฉด์ด๋ผ๋ฉด ํ๋์ Screen์ ํตํด์ ๊ตฌํํ์ ๋ ์ถฉ๋ถํ ๊ฒ ๊ฐ์์!
composable(TodoRoute.TODO) { | ||
TodoScreen() | ||
} | ||
} | ||
|
||
object TodoRoute { | ||
const val TODO = "Todo" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ํ๋ฉด ์ ์ด๋ ํ๋์??
navigate()์ route ๊ฐ๊ณผ composable()์ route ๊ฐ์ด ๋์ผํด์ผ ์ค๋ฅ ์์ด ์ ์์ ์ผ๋ก navigation ๋ฉ๋๋ค!
โ ๐๐ต๐ฒ๐ฐ๐ธ-๐๐ถ๐๐
๐ ๐๐๐๐๐ฒ๐
๐๐ช๐ผ๐ฟ๐ธ ๐๐ฒ๐๐ฐ๐ฟ๐ถ๐ฝ๐๐ถ๐ผ๐ป
๐ท ๐ฆ๐ฐ๐ฟ๐ฒ๐ฒ๐ป๐๐ต๐ผ๐
bottom.mp4
๐ฌ ๐ง๐ผ ๐ฅ๐ฒ๐๐ถ๐ฒ๐๐ฒ๐ฟ๐
๋ฉ๋ฅ์ด๋ค์~~!!! ์กฐ๊ธ๋ง ํ๋ด์!! ๋ค๋ค ๋ ์ํ๊ณ ์์ผ๋๊น!
์ด๊ฑฐ ๊ตฌ์กฐ๋ ์ด๋ฐ๊ฐ ํ ๋ฒ ์ซ ์ค๋ช ํด์ฃผ๊ป!!!
๋ค๋ค ๋ฉ๋ํด~๐