-
Notifications
You must be signed in to change notification settings - Fork 2
π :: (#810) ν νλ©΄ ꡬν #811
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
The head ref may contain hidden characters: "feature/810-\uD648-\uD654\uBA74-\uAD6C\uD604"
Changes from 27 commits
5d538e8
7a050a5
dfd3d38
bc045dd
85b797d
6e082c0
3a1521c
cb524b9
d3129dd
c9ed5dc
714abe9
6a880db
fb5f68b
3873625
680ed64
1cecdaa
1b0e25b
28a511a
7890207
011b107
5cad217
8987417
674c121
93853bb
5471c61
5591f6c
89eea07
3605f56
8665f98
93976dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package team.aliens.dms.android.app | ||
|
|
||
| import androidx.annotation.DrawableRes | ||
| import androidx.navigation3.runtime.NavKey | ||
| import team.aliens.dms.android.core.designsystem.foundation.DmsIcon | ||
| import team.aliens.dms.android.feature.main.application.navigation.ApplicationRoute | ||
| import team.aliens.dms.android.feature.main.home.navigation.HomeRoute | ||
| import team.aliens.dms.android.feature.main.mypage.navigation.MyPageRoute | ||
|
|
||
| sealed class BottomMenu( | ||
| val route: NavKey, | ||
| @DrawableRes val icon: Int, | ||
| @DrawableRes val selectedIcon: Int, | ||
| val title: String, | ||
| ) { | ||
| data object Home : BottomMenu( | ||
| route = HomeScreenNav, | ||
| icon = DmsIcon.Home, | ||
| selectedIcon = DmsIcon.HomeFill, | ||
| title = "ν", | ||
| ) | ||
|
|
||
| data object Application : BottomMenu( | ||
| route = ApplicationScreenNav, | ||
| icon = DmsIcon.CheckCircle, | ||
| selectedIcon = DmsIcon.CheckCircleFill, | ||
| title = "μ μ²", | ||
| ) | ||
|
|
||
| data object MyPage : BottomMenu( | ||
| route = MyPageScreenNav, | ||
| icon = DmsIcon.MyPage, | ||
| selectedIcon = DmsIcon.MyPageFill, | ||
| title = "λ§μ΄νμ΄μ§", | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| package team.aliens.dms.android.app | ||
|
|
||
| import androidx.compose.animation.animateColorAsState | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.BottomAppBar | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.NavigationBarItem | ||
| import androidx.compose.material3.NavigationBarItemColors | ||
| import androidx.compose.material3.NavigationBarItemDefaults | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.navigation3.runtime.NavKey | ||
| import team.aliens.dms.android.core.designsystem.DmsTheme | ||
| import team.aliens.dms.android.core.designsystem.labelB | ||
|
|
||
| private val bottomMenus = listOf( | ||
| BottomMenu.Home, | ||
| BottomMenu.Application, | ||
| BottomMenu.MyPage, | ||
| ) | ||
|
|
||
| @Composable | ||
| fun BottomNavigationBar( | ||
| currentScreen: NavKey?, | ||
| onNavigate: (NavKey) -> Unit, | ||
| ) { | ||
|
|
||
| BottomAppBar( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clip(RoundedCornerShape(topStart = 32.dp, topEnd = 32.dp)), | ||
| containerColor = DmsTheme.colorScheme.surfaceTint, | ||
| ) { | ||
| bottomMenus.forEach { destination -> | ||
| val selected = currentScreen == destination.route | ||
| val color by animateColorAsState( | ||
| targetValue = if (selected) { | ||
| DmsTheme.colorScheme.inverseOnSurface | ||
| } else { | ||
| DmsTheme.colorScheme.scrim | ||
| }, | ||
| ) | ||
|
|
||
| NavigationBarItem( | ||
| selected = selected, | ||
| enabled = !selected, | ||
| onClick = { | ||
| onNavigate(destination.route) | ||
| }, | ||
| colors = NavigationBarItemDefaults.colors( | ||
| indicatorColor = Color.Transparent, | ||
| ), | ||
| icon = { | ||
| Column( | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Icon( | ||
| modifier = Modifier.size(32.dp), | ||
| painter = painterResource(id = if (selected) destination.selectedIcon else destination.icon), | ||
| contentDescription = destination.title, | ||
| tint = color, | ||
| ) | ||
| Text( | ||
| text = destination.title, | ||
| style = DmsTheme.typography.labelB, | ||
| color = color, | ||
| ) | ||
| } | ||
| }, | ||
| ) | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,30 +1,31 @@ | ||||||||||||
| package team.aliens.dms.android.app | ||||||||||||
|
|
||||||||||||
| import androidx.compose.foundation.layout.Box | ||||||||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||||||||
| import androidx.compose.foundation.layout.navigationBarsPadding | ||||||||||||
| import androidx.compose.foundation.layout.padding | ||||||||||||
| import androidx.compose.foundation.layout.statusBarsPadding | ||||||||||||
| import androidx.compose.foundation.layout.systemBarsPadding | ||||||||||||
| import androidx.compose.material3.Scaffold | ||||||||||||
| import androidx.compose.material3.SnackbarHost | ||||||||||||
| import androidx.compose.material3.Text | ||||||||||||
| import androidx.compose.material3.windowsizeclass.WindowSizeClass | ||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||
| import androidx.compose.runtime.LaunchedEffect | ||||||||||||
| import androidx.compose.runtime.collectAsState | ||||||||||||
| import androidx.compose.runtime.getValue | ||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||
| import androidx.compose.ui.zIndex | ||||||||||||
| import androidx.navigation3.runtime.NavKey | ||||||||||||
| import androidx.navigation3.runtime.entryProvider | ||||||||||||
| import androidx.navigation3.runtime.rememberNavBackStack | ||||||||||||
| import androidx.navigation3.ui.NavDisplay | ||||||||||||
| import kotlinx.coroutines.flow.StateFlow | ||||||||||||
| import kotlinx.serialization.Serializable | ||||||||||||
| import team.aliens.dms.android.core.designsystem.DmsTheme | ||||||||||||
| import team.aliens.dms.android.core.designsystem.snackbar.DmsSnackBar | ||||||||||||
| import team.aliens.dms.android.core.designsystem.snackbar.DmsSnackBarVisuals | ||||||||||||
| import team.aliens.dms.android.feature.main.application.navigation.ApplicationRoute | ||||||||||||
| import team.aliens.dms.android.feature.main.home.navigation.HomeRoute | ||||||||||||
| import team.aliens.dms.android.feature.main.mypage.navigation.MyPageRoute | ||||||||||||
| import team.aliens.dms.android.feature.meal.navigation.MealRoute | ||||||||||||
| import team.aliens.dms.android.feature.onboarding.navigation.OnboardingRoute | ||||||||||||
| import team.aliens.dms.android.feature.signin.navigation.SignInRoute | ||||||||||||
|
|
||||||||||||
|
|
@@ -35,7 +36,16 @@ data object OnboardingScreenNav : NavKey | |||||||||||
| data object SignInScreenNav : NavKey | ||||||||||||
|
|
||||||||||||
| @Serializable | ||||||||||||
| data object MainScreenNav : NavKey | ||||||||||||
| data object HomeScreenNav : NavKey | ||||||||||||
|
|
||||||||||||
| @Serializable | ||||||||||||
| data object MealScreenNav : NavKey | ||||||||||||
|
|
||||||||||||
| @Serializable | ||||||||||||
| data object ApplicationScreenNav : NavKey | ||||||||||||
|
|
||||||||||||
| @Serializable | ||||||||||||
| data object MyPageScreenNav : NavKey | ||||||||||||
|
|
||||||||||||
| @Composable | ||||||||||||
| fun DmsApp( | ||||||||||||
|
|
@@ -48,11 +58,16 @@ fun DmsApp( | |||||||||||
| val isJwtAvailableState by isJwtAvailable.collectAsState() | ||||||||||||
|
|
||||||||||||
| val backStack = rememberNavBackStack(OnboardingScreenNav) | ||||||||||||
| val currentScreen = backStack.lastOrNull() | ||||||||||||
| val shouldShowBottomBar = currentScreen in listOf( | ||||||||||||
| SignInScreenNav, | ||||||||||||
| OnboardingScreenNav, | ||||||||||||
| ) | ||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| LaunchedEffect(isOnboardingCompleted, isJwtAvailableState) { | ||||||||||||
| val initialScreen = when { | ||||||||||||
| !isOnboardingCompleted -> OnboardingScreenNav | ||||||||||||
| isJwtAvailableState -> MainScreenNav | ||||||||||||
| isJwtAvailableState -> HomeScreenNav | ||||||||||||
| else -> SignInScreenNav | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
@@ -62,11 +77,31 @@ fun DmsApp( | |||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| Box( | ||||||||||||
| modifier = Modifier.fillMaxWidth(), | ||||||||||||
| ) { | ||||||||||||
| Scaffold( | ||||||||||||
| modifier = Modifier | ||||||||||||
| .fillMaxWidth(), | ||||||||||||
| bottomBar = { | ||||||||||||
| if (!shouldShowBottomBar) { | ||||||||||||
| BottomNavigationBar( | ||||||||||||
| currentScreen = currentScreen, | ||||||||||||
| onNavigate = { destination -> | ||||||||||||
| if (currentScreen != destination) { | ||||||||||||
| backStack.removeAll { | ||||||||||||
| it is HomeScreenNav || | ||||||||||||
| it is ApplicationScreenNav || | ||||||||||||
| it is MyPageScreenNav | ||||||||||||
| } | ||||||||||||
| backStack.add(destination) | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| ) | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| ) { _ -> | ||||||||||||
| NavDisplay( | ||||||||||||
| modifier = Modifier.systemBarsPadding(), | ||||||||||||
| modifier = Modifier | ||||||||||||
| .navigationBarsPadding() | ||||||||||||
| .systemBarsPadding(), | ||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
| modifier = Modifier | |
| .navigationBarsPadding() | |
| .systemBarsPadding(), | |
| modifier = Modifier | |
| .systemBarsPadding(), |
π€ Prompt for AI Agents
In app/src/dev/kotlin/team/aliens/dms/android/app/DmsApp.kt around lines 102 to
104, the NavDisplay modifier applies both navigationBarsPadding() and
systemBarsPadding(), which is redundant because systemBarsPadding() already
includes navigation bar insets; remove the navigationBarsPadding() call and
leave only systemBarsPadding() on the modifier so the component still receives
status and navigation bar padding without duplication.
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.
Enable desugaring for prod flavor as well.
Desugaring is only enabled for the dev flavor, but the
coreLibraryDesugaringdependency is added globally (Line 147). Since the PR migrates tojava.timeAPIs andminSdk = 23(API 23 < 26), the prod build will crash at runtime when usingjava.timeclasses without desugaring.π Proposed fix to enable desugaring for prod flavor
create("prod") { dimension = "environment" buildConfigField("String", "ENVIRONMENT", "\"prod\"") + + compileOptions { + isCoreLibraryDesugaringEnabled = true + } }π€ Prompt for AI Agents