Skip to content

Commit 139fc86

Browse files
committed
Merge branch 'develop' into refactor/#98-redesign_write_routine
# Conflicts: # presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt
2 parents 6e1cc47 + a29f624 commit 139fc86

147 files changed

Lines changed: 3333 additions & 2325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
tools:targetApi="31">
1818
<activity
1919
android:name=".MainActivity"
20+
android:windowSoftInputMode="adjustResize"
2021
android:exported="true"
2122
android:theme="@style/Theme.Bitnagil">
2223
<intent-filter>

app/src/main/java/com/threegap/bitnagil/MainNavHost.kt

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import androidx.navigation.compose.composable
88
import androidx.navigation.toRoute
99
import com.threegap.bitnagil.navigation.home.HomeNavHost
1010
import com.threegap.bitnagil.presentation.emotion.EmotionScreenContainer
11+
import com.threegap.bitnagil.presentation.guide.GuideScreenContainer
1112
import com.threegap.bitnagil.presentation.login.LoginScreenContainer
1213
import com.threegap.bitnagil.presentation.onboarding.OnBoardingScreenContainer
1314
import com.threegap.bitnagil.presentation.onboarding.OnBoardingViewModel
1415
import com.threegap.bitnagil.presentation.onboarding.model.navarg.OnBoardingScreenArg
16+
import com.threegap.bitnagil.presentation.routinelist.RoutineListScreenContainer
1517
import com.threegap.bitnagil.presentation.setting.SettingScreenContainer
1618
import com.threegap.bitnagil.presentation.splash.SplashScreenContainer
1719
import com.threegap.bitnagil.presentation.terms.TermsAgreementScreenContainer
1820
import com.threegap.bitnagil.presentation.webview.BitnagilWebViewScreen
21+
import com.threegap.bitnagil.presentation.withdrawal.WithdrawalScreenContainer
1922
import com.threegap.bitnagil.presentation.writeroutine.WriteRoutineScreenContainer
2023
import com.threegap.bitnagil.presentation.writeroutine.WriteRoutineViewModel
2124
import com.threegap.bitnagil.presentation.writeroutine.model.navarg.WriteRoutineScreenArg
@@ -111,15 +114,24 @@ fun MainNavHost(
111114
),
112115
)
113116
},
117+
navigateToGuide = {
118+
navigator.navController.navigate(Route.Guide) {
119+
launchSingleTop = true
120+
}
121+
},
114122
navigateToRegisterRoutine = { routineId ->
115123
navigator.navController.navigate(Route.WriteRoutine(routineId = routineId))
116124
},
117-
navigateToEditRoutine = { routineId ->
118-
navigator.navController.navigate(Route.WriteRoutine(routineId = routineId, isRegister = false))
119-
},
120125
navigateToEmotion = {
121126
navigator.navController.navigate(Route.Emotion)
122127
},
128+
navigateToRoutineList = { selectedDate ->
129+
navigator.navController.navigate(
130+
Route.RoutineList(selectedDate = selectedDate),
131+
) {
132+
launchSingleTop = true
133+
}
134+
},
123135
)
124136
}
125137

@@ -166,6 +178,9 @@ fun MainNavHost(
166178
}
167179
}
168180
},
181+
navigateToWithdrawal = {
182+
navigator.navController.navigate(Route.Withdrawal)
183+
},
169184
)
170185
}
171186

@@ -223,5 +238,42 @@ fun MainNavHost(
223238
},
224239
)
225240
}
241+
242+
composable<Route.Withdrawal> {
243+
WithdrawalScreenContainer(
244+
navigateToBack = {
245+
if (navigator.navController.previousBackStackEntry != null) {
246+
navigator.navController.popBackStack()
247+
}
248+
},
249+
navigateToLogin = {
250+
navigator.navController.navigate(Route.Login) {
251+
popUpTo(0) {
252+
inclusive = true
253+
}
254+
}
255+
},
256+
)
257+
}
258+
259+
composable<Route.RoutineList> {
260+
RoutineListScreenContainer(
261+
navigateToBack = {
262+
if (navigator.navController.previousBackStackEntry != null) {
263+
navigator.navController.popBackStack()
264+
}
265+
},
266+
)
267+
}
268+
269+
composable<Route.Guide> {
270+
GuideScreenContainer(
271+
navigateToBack = {
272+
if (navigator.navController.previousBackStackEntry != null) {
273+
navigator.navController.popBackStack()
274+
}
275+
},
276+
)
277+
}
226278
}
227279
}

app/src/main/java/com/threegap/bitnagil/MainScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.threegap.bitnagil
22

33
import androidx.compose.foundation.layout.WindowInsets
4-
import androidx.compose.foundation.layout.WindowInsetsSides
4+
import androidx.compose.foundation.layout.exclude
55
import androidx.compose.foundation.layout.fillMaxSize
6-
import androidx.compose.foundation.layout.only
6+
import androidx.compose.foundation.layout.ime
7+
import androidx.compose.foundation.layout.navigationBars
78
import androidx.compose.foundation.layout.padding
8-
import androidx.compose.foundation.layout.systemBars
99
import androidx.compose.material3.Scaffold
1010
import androidx.compose.runtime.Composable
1111
import androidx.compose.ui.Modifier
@@ -18,7 +18,7 @@ fun MainScreen(
1818
) {
1919
Scaffold(
2020
modifier = modifier.fillMaxSize(),
21-
contentWindowInsets = WindowInsets.systemBars.only(WindowInsetsSides.Bottom),
21+
contentWindowInsets = WindowInsets.navigationBars.exclude(WindowInsets.ime),
2222
containerColor = BitnagilTheme.colors.white,
2323
) { innerPadding ->
2424
MainNavHost(

app/src/main/java/com/threegap/bitnagil/Route.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,13 @@ sealed interface Route {
3939

4040
@Serializable
4141
data object Emotion : Route
42+
43+
@Serializable
44+
data object Withdrawal : Route
45+
46+
@Serializable
47+
data class RoutineList(val selectedDate: String) : Route
48+
49+
@Serializable
50+
data object Guide : Route
4251
}

app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.height
1212
import androidx.compose.foundation.layout.padding
1313
import androidx.compose.foundation.layout.size
14+
import androidx.compose.material3.HorizontalDivider
1415
import androidx.compose.material3.Text
1516
import androidx.compose.runtime.Composable
1617
import androidx.compose.runtime.getValue
@@ -30,27 +31,34 @@ fun HomeBottomNavigationBar(
3031
) {
3132
val navBackStackEntry by navController.currentBackStackEntryAsState()
3233

33-
Row(
34-
modifier = Modifier
35-
.fillMaxWidth()
36-
.background(color = BitnagilTheme.colors.white)
37-
.height(62.dp)
38-
.padding(horizontal = 16.dp, vertical = 7.dp),
39-
horizontalArrangement = Arrangement.spacedBy(10.dp),
40-
verticalAlignment = Alignment.CenterVertically,
41-
) {
42-
HomeRoute.entries.map { homeRoute ->
43-
HomeBottomNavigationItem(
44-
modifier = Modifier.weight(1f),
45-
icon = homeRoute.icon,
46-
title = homeRoute.title,
47-
onClick = {
48-
navController.navigate(homeRoute.route) {
49-
popUpTo(0) { inclusive = true }
50-
}
51-
},
52-
selected = navBackStackEntry?.destination?.route == homeRoute.route,
53-
)
34+
Column {
35+
HorizontalDivider(
36+
modifier = Modifier.fillMaxWidth(),
37+
thickness = 1.dp,
38+
color = BitnagilTheme.colors.coolGray98,
39+
)
40+
Row(
41+
modifier = Modifier
42+
.fillMaxWidth()
43+
.background(color = BitnagilTheme.colors.white)
44+
.height(62.dp)
45+
.padding(horizontal = 16.dp, vertical = 7.dp),
46+
horizontalArrangement = Arrangement.spacedBy(10.dp),
47+
verticalAlignment = Alignment.CenterVertically,
48+
) {
49+
HomeRoute.entries.map { homeRoute ->
50+
HomeBottomNavigationItem(
51+
modifier = Modifier.weight(1f),
52+
icon = homeRoute.icon,
53+
title = homeRoute.title,
54+
onClick = {
55+
navController.navigate(homeRoute.route) {
56+
popUpTo(0) { inclusive = true }
57+
}
58+
},
59+
selected = navBackStackEntry?.destination?.route == homeRoute.route,
60+
)
61+
}
5462
}
5563
}
5664
}

app/src/main/java/com/threegap/bitnagil/navigation/home/HomeNavHost.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ fun HomeNavHost(
3939
navigateToOnBoarding: () -> Unit,
4040
navigateToNotice: () -> Unit,
4141
navigateToQnA: () -> Unit,
42+
navigateToGuide: () -> Unit,
4243
navigateToRegisterRoutine: (String?) -> Unit,
43-
navigateToEditRoutine: (String) -> Unit,
4444
navigateToEmotion: () -> Unit,
45+
navigateToRoutineList: (String) -> Unit,
4546
) {
4647
val navigator = rememberHomeNavigator()
4748
var showFloatingOverlay by remember { mutableStateOf(false) }
@@ -63,11 +64,14 @@ fun HomeNavHost(
6364
) {
6465
composable(HomeRoute.Home.route) {
6566
HomeScreenContainer(
67+
navigateToGuide = navigateToGuide,
6668
navigateToRegisterRoutine = {
6769
navigateToRegisterRoutine(null)
6870
},
69-
navigateToEditRoutine = navigateToEditRoutine,
7071
navigateToEmotion = navigateToEmotion,
72+
navigateToRoutineList = { selectedDate ->
73+
navigateToRoutineList(selectedDate)
74+
},
7175
)
7276
}
7377

@@ -102,11 +106,6 @@ fun HomeNavHost(
102106

103107
BitnagilFloatingActionMenu(
104108
actions = listOf(
105-
FloatingActionItem(
106-
icon = R.drawable.ic_report,
107-
text = "제보하기",
108-
onClick = { GlobalBitnagilToast.showWarning("제보하기 기능은 추후 제공될 예정입니다.") },
109-
),
110109
FloatingActionItem(
111110
icon = R.drawable.ic_routine_add,
112111
text = "루틴 등록",

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/color/BitnagilColors.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ data class BitnagilColors(
1515
val purple10: Color = Purple10,
1616
val green10: Color = Green10,
1717
val pink10: Color = Pink10,
18+
val yellow10: Color = Yellow10,
1819
val progressBarGradientStartColor: Color = ProgressBarGradientStartColor,
1920
val progressBarGradientEndColor: Color = ProgressBarGradientEndColor,
2021
val homeGradientStartColor: Color = HomeGradientStartColor,

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/color/Color.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ val SkyBlue10 = Color(0xFFDBF1FF)
1111
val Purple10 = Color(0xFFE6E2FF)
1212
val Green10 = Color(0xFFE6F5C6)
1313
val Pink10 = Color(0xFFFEE3E9)
14+
val Yellow10 = Color(0xFFFFF5C7)
1415
val ProgressBarGradientStartColor = Color(0xFFA9CFFF)
1516
val ProgressBarGradientEndColor = Color(0xFFFFCDB3)
1617
val HomeGradientStartColor = Color(0xFFFFEADF)

0 commit comments

Comments
 (0)