Skip to content

Commit

Permalink
Merge branch 'dev' into feature/implement-profile-create
Browse files Browse the repository at this point in the history
  • Loading branch information
eshc123 authored Aug 3, 2024
2 parents 9e80ec4 + 7391646 commit f6e5656
Show file tree
Hide file tree
Showing 21 changed files with 1,310 additions and 13 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<resources>
<string name="app_name">mission-mate</string>

<string name="monday_short">월</string>
<string name="tuesday_short">화</string>
<string name="wednesday_short">수</string>
<string name="thursday_short">목</string>
<string name="friday_short">금</string>
<string name="saturday_short">토</string>
<string name="sunday_short">일</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ sealed interface OnboardingRouteModel {
@Serializable
data object BoardSetup : OnboardingRouteModel

@Serializable
data object BoardSetupSuccess : OnboardingRouteModel

@Serializable
data object InvitationCode : OnboardingRouteModel
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import com.goalpanzi.mission_mate.feature.login.loginNavGraph
import com.goalpanzi.mission_mate.feature.onboarding.boardSetupNavGraph
import com.goalpanzi.mission_mate.feature.onboarding.boardSetupSuccessNavGraph
import com.goalpanzi.mission_mate.feature.onboarding.invitationCodeNavGraph
import com.goalpanzi.mission_mate.feature.onboarding.onboardingNavGraph
import com.luckyoct.feature.profile.ProfileSettingType
Expand All @@ -34,11 +35,23 @@ internal fun MainNavHost(
onLoginSuccess = { if (it) navigator.navigationToOnboarding() else navigator.navigateToProfileCreate() }
)
onboardingNavGraph(
onClickBoardSetup = { },
onClickInvitationCode = { },
onClickSetting = { }
onClickBoardSetup = { navigator.navigationToBoardSetup() },
onClickInvitationCode = { navigator.navigationToInvitationCode() },
onClickSetting = { }
)
boardSetupNavGraph(
onSuccess = {
navigator.navigationToBoardSetupSuccess()
},
onBackClick = {
navigator.popBackStack()
}
)
boardSetupSuccessNavGraph(
onClickStart = {

}
)
boardSetupNavGraph()
invitationCodeNavGraph()
profileNavGraph(
onSaveSuccess = { navigator.navigationToOnboarding() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.navigation.compose.rememberNavController
import com.goalpanzi.mission_mate.core.navigation.RouteModel
import com.goalpanzi.mission_mate.feature.login.navigateToLogin
import com.goalpanzi.mission_mate.feature.onboarding.navigateToBoardSetup
import com.goalpanzi.mission_mate.feature.onboarding.navigateToBoardSetupSuccess
import com.goalpanzi.mission_mate.feature.onboarding.navigateToInvitationCode
import com.goalpanzi.mission_mate.feature.onboarding.navigateToOnboarding
import com.luckyoct.feature.profile.navigateToProfileCreate
Expand Down Expand Up @@ -38,6 +39,10 @@ class MainNavigator(
navController.navigateToBoardSetup()
}

fun navigationToBoardSetupSuccess() {
navController.navigateToBoardSetupSuccess()
}

fun navigationToInvitationCode() {
navController.navigateToInvitationCode()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.goalpanzi.mission_mate.core.navigation.OnboardingRouteModel
import com.goalpanzi.mission_mate.core.navigation.RouteModel
import com.goalpanzi.mission_mate.feature.onboarding.screen.OnboardingRoute
import com.goalpanzi.mission_mate.feature.onboarding.screen.boardsetup.BoardSetupRoute
import com.goalpanzi.mission_mate.feature.onboarding.screen.boardsetup.BoardSetupSuccessScreen

fun NavController.navigateToOnboarding() {
this.navigate(RouteModel.Onboarding)
Expand All @@ -14,14 +17,18 @@ fun NavController.navigateToBoardSetup() {
this.navigate(OnboardingRouteModel.BoardSetup)
}

fun NavController.navigateToBoardSetupSuccess() {
this.navigate(OnboardingRouteModel.BoardSetupSuccess)
}

fun NavController.navigateToInvitationCode() {
this.navigate(OnboardingRouteModel.InvitationCode)
}

fun NavGraphBuilder.onboardingNavGraph(
onClickBoardSetup : () -> Unit,
onClickInvitationCode : () -> Unit,
onClickSetting : () -> Unit
onClickBoardSetup: () -> Unit,
onClickInvitationCode: () -> Unit,
onClickSetting: () -> Unit
) {
composable<RouteModel.Onboarding> {
OnboardingRoute(
Expand All @@ -32,14 +39,29 @@ fun NavGraphBuilder.onboardingNavGraph(
}
}

fun NavGraphBuilder.boardSetupNavGraph() {
fun NavGraphBuilder.boardSetupNavGraph(
onSuccess: () -> Unit,
onBackClick: () -> Unit
) {
composable<OnboardingRouteModel.BoardSetup> {
BoardSetupRoute(
onSuccess = onSuccess,
onBackClick = onBackClick
)
}
}

fun NavGraphBuilder.boardSetupSuccessNavGraph(
onClickStart: () -> Unit
) {
composable<OnboardingRouteModel.BoardSetupSuccess> {
BoardSetupSuccessScreen(
onClickStart = onClickStart
)
}
}

fun NavGraphBuilder.invitationCodeNavGraph() {
composable<OnboardingRouteModel.InvitationCode> {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.goalpanzi.mission_mate.feature.onboarding.component

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowLeft
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.goalpanzi.mission_mate.core.designsystem.theme.ColorGray1_FF404249
import com.goalpanzi.mission_mate.core.designsystem.theme.MissionMateTypography
import com.goalpanzi.mission_mate.feature.onboarding.R

@Composable
fun BoardSetupNavigationBar(
onBackClick: () -> Unit,
currentStep: () -> Int,
modifier: Modifier = Modifier,
maxStep: Int = 3,
) {
Column(
modifier = modifier
) {
IconButton(
modifier = Modifier.padding(start = 4.dp),
onClick = onBackClick
) {
Icon(
modifier = Modifier.size(24.dp),
imageVector = Icons.Default.KeyboardArrowLeft, // merge 전까지 임시 사용
contentDescription = null
)
}
Row(
modifier = Modifier.padding(16.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(
id = when (currentStep()) {
1 -> R.string.onboarding_board_setup_mission_title
2 -> R.string.onboarding_board_setup_schedule_title
else -> R.string.onboarding_board_setup_verification_time_title
}
),
modifier = Modifier
.wrapContentHeight()
.weight(1f)
.padding(start = 8.dp, end = 8.dp),
style = MissionMateTypography.heading_sm_bold,
color = ColorGray1_FF404249
)
OutlinedTextBox(
text = "${currentStep()}/$maxStep",
textStyle = MissionMateTypography.body_lg_regular
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.goalpanzi.mission_mate.feature.onboarding.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.DatePicker
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SelectableDates
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.rememberDatePickerState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import com.goalpanzi.mission_mate.core.designsystem.component.MissionMateButton
import com.goalpanzi.mission_mate.core.designsystem.component.MissionMateButtonType
import com.goalpanzi.mission_mate.feature.onboarding.util.DateUtils.localDateToMillis
import java.time.LocalDate

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DatePickerDialog(
selectedDate: LocalDate?,
selectableStartDate: LocalDate?,
selectableEndDate: LocalDate?,
onSuccess: (Long) -> Unit,
onDismiss: () -> Unit
) {
val datePickerState = rememberDatePickerState(
initialSelectedDateMillis = selectedDate?.let { localDateToMillis(it) },
selectableDates = object : SelectableDates {
override fun isSelectableDate(utcTimeMillis: Long): Boolean {
val startMillis = localDateToMillis(selectableStartDate)
val endMillis = localDateToMillis(selectableEndDate)
val currentMillis = utcTimeMillis
return (startMillis ?: Long.MIN_VALUE) <= currentMillis && (endMillis
?: Long.MAX_VALUE) >= currentMillis
}
}
)
Dialog(
properties = DialogProperties(usePlatformDefaultWidth = false),
onDismissRequest = onDismiss
) {
Surface(
modifier = Modifier
.padding(horizontal = 4.dp, vertical = 12.dp)
.fillMaxWidth()
) {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {

DatePicker(state = datePickerState)
MissionMateButton(
buttonType = if (datePickerState.selectedDateMillis == null) MissionMateButtonType.DISABLED
else MissionMateButtonType.SECONDARY,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp, vertical = 12.dp),
onClick = {
datePickerState.selectedDateMillis?.let { onSuccess(it) }
}
) {
Text(text = "Ok")
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.goalpanzi.mission_mate.feature.onboarding.model

import androidx.annotation.StringRes
import com.goalpanzi.mission_mate.feature.onboarding.R

enum class VerificationTimeType(
@StringRes val titleId : Int
) {
Am(R.string.onboarding_board_setup_verification_time_input_content_am),
Pm(R.string.onboarding_board_setup_verification_time_input_content_pm),
All(R.string.onboarding_board_setup_verification_time_input_content_all)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.goalpanzi.mission_mate.feature.onboarding
package com.goalpanzi.mission_mate.feature.onboarding.screen

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
Expand All @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand All @@ -24,6 +25,7 @@ import androidx.compose.ui.unit.dp
import com.goalpanzi.mission_mate.core.designsystem.theme.ColorGray1_FF404249
import com.goalpanzi.mission_mate.core.designsystem.theme.ColorWhite_FFFFFFFF
import com.goalpanzi.mission_mate.core.designsystem.theme.MissionMateTypography
import com.goalpanzi.mission_mate.feature.onboarding.R
import com.goalpanzi.mission_mate.feature.onboarding.component.OnboardingNavigationButton
import com.goalpanzi.mission_mate.feature.onboarding.component.OutlinedTextBox
import com.goalpanzi.mission_mate.feature.onboarding.component.StableImage
Expand Down Expand Up @@ -63,12 +65,12 @@ fun OnboardingScreen(
contentScale = ContentScale.FillWidth
)
Column(
modifier = modifier,
modifier = modifier.statusBarsPadding(),
horizontalAlignment = Alignment.CenterHorizontally
) {
IconButton(
modifier = Modifier
.padding(end = 10.dp, top = 24.dp)
.padding(end = 10.dp)
.align(Alignment.End),
onClick = onClickSetting
) {
Expand All @@ -85,7 +87,7 @@ fun OnboardingScreen(
color = ColorGray1_FF404249
)
OutlinedTextBox(
text = stringResource(id = R.string.onboarding_level_1),
text = stringResource(id = R.string.onboarding_level_1),
modifier = Modifier.padding(bottom = 23.dp)
)
Box(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.goalpanzi.mission_mate.feature.onboarding.screen.boardsetup

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.goalpanzi.mission_mate.core.designsystem.component.MissionMateTextFieldGroup
import com.goalpanzi.mission_mate.feature.onboarding.R

@Composable
fun BoardSetupMission(
missionTitle : String,
onTitleChange : (String) -> Unit,
modifier: Modifier = Modifier
){
Column(
modifier = modifier
.fillMaxSize()
.padding(horizontal = 24.dp)
) {
BoardSetupDescription(
text = stringResource(id = R.string.onboarding_board_setup_mission_description),
colorTargetTexts = listOf(
stringResource(R.string.onboarding_board_setup_mission_description_color_target1),
stringResource(R.string.onboarding_board_setup_mission_description_color_target2)
)
)
MissionMateTextFieldGroup(
modifier = modifier.fillMaxWidth(),
text = missionTitle,
onValueChange = onTitleChange,
useMaxLength = true,
maxLength = 12,
titleId = R.string.onboarding_board_setup_mission_input_title,
hintId = R.string.onboarding_board_setup_mission_input_hint,
guidanceId = R.string.onboarding_board_setup_mission_input_guide,
)
}
}
Loading

0 comments on commit f6e5656

Please sign in to comment.