Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

15 changes: 0 additions & 15 deletions app/src/main/java/com/kiero/data/auth/remote/api/DummyService.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import NormalScheduleDto
import PlanAllResponseDto
import RecurringScheduleDto
import com.kiero.data.parent.plan.remote.dto.response.PlanColorResponseDto
import com.kiero.presentation.parent.screen.schedule.model.ScheduleEvent

data class PlanColorModel(
val scheduleColor : String,
Expand Down Expand Up @@ -59,4 +60,26 @@ fun NormalScheduleDto.toModel(): NormalScheduleModel = NormalScheduleModel(
name = this.name,
colorCode = this.colorCode,
date = this.date
)

fun RecurringScheduleModel.toUiModel() = ScheduleEvent(
id = "recurring_${name}_${startTime}",
name = name,
isRecurring = true,
startTime = startTime,
endTime = endTime,
scheduleColor = colorCode,
dayOfWeek = dayOfWeek,
date = null
)

fun NormalScheduleModel.toUiModel() = ScheduleEvent(
id = "normal_${name}_${date}",
name = name,
isRecurring = false,
startTime = startTime,
endTime = endTime,
scheduleColor = colorCode,
dayOfWeek = null,
date = date
)
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fun AuthScreen(

@Preview
@Composable
private fun DummyScreenPreview() {
private fun AuthScreenPreview() {
KieroTheme {
AuthScreen(
paddingValues = PaddingValues(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.kiero.presentation.kid.navigation.kidNavGraph
import com.kiero.presentation.parent.navigation.parentNavGraph
import com.kiero.presentation.signup.parent.navigation.parentSignUpNavGraph
import com.kiero.presentation.splash.navigation.splashNavGraph
import timber.log.Timber

@Composable
fun KieroNavHost(
Expand Down Expand Up @@ -89,7 +88,8 @@ fun KieroNavHost(
navController = appState.navController,
paddingValues = paddingValues,
navigateUp = appState::navigateUp,
navigateToSelection = appState::navigateToSelection
navigateToSelection = appState::navigateToSelection,
navigateToAlarm = appState::navigateToAlarm
)

kidNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ import com.kiero.presentation.kid.navigation.Mission
import com.kiero.presentation.kid.navigation.Wish
import com.kiero.presentation.kid.onboarding.navigation.navigateToKidOnboarding
import com.kiero.presentation.kid.wish.navigation.navigateToWish
import com.kiero.presentation.parent.alarm.navigation.navigateToAlarm
import com.kiero.presentation.parent.navigation.Alarm
import com.kiero.presentation.parent.screen.alarm.navigation.navigateToAlarm
import com.kiero.presentation.parent.screen.journey.navigation.navigateToParentJourney
import com.kiero.presentation.parent.screen.mypage.navigation.navigateToMypage
import com.kiero.presentation.parent.navigation.Mypage
import com.kiero.presentation.parent.navigation.ParentGraph
import com.kiero.presentation.parent.navigation.ParentJourney
import com.kiero.presentation.parent.navigation.ParentMission
import com.kiero.presentation.parent.navigation.Reward
import com.kiero.presentation.parent.navigation.Schedule
import com.kiero.presentation.parent.schedule.mission.navigation.navigateToMissionAdd
import com.kiero.presentation.parent.schedule.navigation.navigateToSchedule
import com.kiero.presentation.parent.schedule.plan.navigation.navigateToScheduleAdd
import com.kiero.presentation.parent.screen.mission.navigation.navigateToMissionAdd
import com.kiero.presentation.parent.screen.mission.navigation.navigateToParentMission
import com.kiero.presentation.parent.screen.reward.navigation.navigateToReward
import com.kiero.presentation.parent.screen.schedule.navigation.navigateToSchedule
import com.kiero.presentation.parent.screen.schedule.plan.navigation.navigateToScheduleAdd
import com.kiero.presentation.signup.parent.navigation.navigateToParentSignUp
import com.kiero.presentation.splash.navigation.Splash
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -149,7 +156,7 @@ class MainAppState(
}

fun navigateToAuth(
navOptions: NavOptions? = null
navOptions: NavOptions? = null,
) {
navController.navigate(AuthGraph) {
popUpTo(0) {
Expand All @@ -166,8 +173,11 @@ class MainAppState(
restoreState = true
}
when (tab) {
ParentMainTab.JOURNEY -> navController.navigate(ParentJourney, navOptions)
ParentMainTab.SCHEDULE -> navController.navigate(Schedule, navOptions)
ParentMainTab.ALARM -> navController.navigate(Alarm, navOptions)
ParentMainTab.MISSION -> navController.navigate(ParentMission, navOptions)
ParentMainTab.REWARD -> navController.navigate(Reward, navOptions)
ParentMainTab.MYPAGE -> navController.navigate(Mypage, navOptions)
}
}

Expand Down Expand Up @@ -199,6 +209,12 @@ class MainAppState(
fun navigateToWish(navOptions: NavOptions? = null) =
navController.navigateToWish(navOptions)

fun navigateToMypage(navOptions: NavOptions? = null) =
navController.navigateToMypage(navOptions)

fun navigateToReward(navOptions: NavOptions? = null) =
navController.navigateToReward(navOptions)

fun navigateToScheduleAdd(
initialDate: String,
isFireLit: Boolean,
Expand All @@ -211,7 +227,7 @@ class MainAppState(
fun navigateToCamera(
scheduleDetailId: Long,
stoneType: StoneUiType,
navOptions: NavOptions? = null
navOptions: NavOptions? = null,
) = navController.navigateToCamera(
scheduleDetailId = scheduleDetailId,
stoneType = stoneType,
Expand All @@ -221,7 +237,7 @@ class MainAppState(
fun navigateToFire(
date: String,
stones: Int,
navOptions: NavOptions? = null
navOptions: NavOptions? = null,
) = navController.navigateToFire(
date = date,
stones = stones,
Expand All @@ -230,12 +246,18 @@ class MainAppState(

fun navigateToFireResult(
date: String,
navOptions: NavOptions? = null
navOptions: NavOptions? = null,
) = navController.navigateToFireResult(
date = date,
navOptions = navOptions
)

fun navigateToParentMission(navOptions: NavOptions? = null) =
navController.navigateToParentMission(navOptions)

fun navigateToParentJourney(navOptions: NavOptions? = null) =
navController.navigateToParentJourney(navOptions)

fun navigateToMissionAdd(navOptions: NavOptions? = null) =
navController.navigateToMissionAdd(navOptions)

Expand Down
45 changes: 34 additions & 11 deletions app/src/main/java/com/kiero/presentation/main/navigation/MainTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import com.kiero.presentation.kid.navigation.Journey
import com.kiero.presentation.kid.navigation.KidTab
import com.kiero.presentation.kid.navigation.Mission
import com.kiero.presentation.kid.navigation.Wish

import com.kiero.presentation.main.navigation.component.BottomBarTab
import com.kiero.presentation.parent.navigation.Alarm
import com.kiero.presentation.parent.navigation.Mypage
import com.kiero.presentation.parent.navigation.ParentJourney
import com.kiero.presentation.parent.navigation.ParentMission
import com.kiero.presentation.parent.navigation.ParentTab
import com.kiero.presentation.parent.navigation.Reward
import com.kiero.presentation.parent.navigation.Schedule

enum class ParentMainTab(
Expand All @@ -19,17 +21,38 @@ enum class ParentMainTab(
@param:StringRes override val labelRes: Int,
val route: ParentTab,
) : BottomBarTab {

JOURNEY(
iconRes = R.drawable.ic_parent_tab_today,
contentDescription = R.string.parent_journey_tab_content_description,
labelRes = R.string.parent_journey_tab_content_description,
route = ParentJourney,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 parent의 route들에 어떤 것은 parent 가 붙고 어떤 것은 안 붙어져 있는 상태이고 kid 역시 그런데 이것을 동일하게 parent나 kid를 붙이도록 하는게 일관성이 있어 파악하기 쉬울까요? 아니면 괜찮을까요?
고민 중인데 여러분 생각은 어떠신가요?
@Team-Kiero/kiero-android

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parent와 kid route 들 중에 중복되는 것들을 구분하기 위해 1차적으로 중복되는 것들에만 Parent 를 붙혔는데, 일관성 있게 처리하는게 좀 더 파악하기 쉬워보이긴 하네요!! 다른 분들 의견 들어보고 일치하면 route들 앞에 parent/kid 로 구분해 놓겠습니다! 감사합니당

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저두 일관성있는게 앞에 붙이는게 나중에 헷갈리지 않고 좋을 것 같다는 생각입니다!

),
SCHEDULE(
iconRes = R.drawable.ic_parent_tab_schedule,
contentDescription = R.string.schedule_tab_content_description,
labelRes = R.string.schedule_tab_content_description,
route = Schedule,
),
ALARM(
iconRes = R.drawable.ic_parent_tab_alarm,
contentDescription = R.string.alarm_tab_content_description,
labelRes = R.string.alarm_tab_content_description,
route = Alarm,

MISSION(
iconRes = R.drawable.ic_parent_tab_mission,
contentDescription = R.string.parent_mission_tab_content_description,
labelRes = R.string.parent_mission_tab_content_description,
route = ParentMission,
),

REWARD(
iconRes = R.drawable.ic_parent_tab_reward,
contentDescription = R.string.reward_tab_content_description,
labelRes = R.string.reward_tab_content_description,
route = Reward,
),
MYPAGE(
iconRes = R.drawable.ic_parent_tab_mypage,
contentDescription = R.string.mypage_tab_content_description,
labelRes = R.string.mypage_tab_content_description,
route = Mypage,
);

companion object {
Expand All @@ -52,14 +75,14 @@ enum class KidMainTab(
) : BottomBarTab {
JOURNEY(
iconRes = R.drawable.ic_kid_tab_journey,
contentDescription = R.string.journey_tab_content_description,
labelRes = R.string.journey_tab_content_description,
contentDescription = R.string.kid_journey_tab_content_description,
labelRes = R.string.kid_journey_tab_content_description,
route = Journey,
),
MISSION(
iconRes = R.drawable.ic_kid_tab_mission,
contentDescription = R.string.mission_tab_content_description,
labelRes = R.string.mission_tab_content_description,
contentDescription = R.string.kid_mission_tab_content_description,
labelRes = R.string.kid_mission_tab_content_description,
route = Mission,
),
WISH(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kiero.core.common.extension.noRippleClickable
import com.kiero.core.designsystem.theme.KieroTheme
import com.kiero.presentation.main.navigation.KidMainTab
import com.kiero.presentation.main.navigation.ParentMainTab
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf

@Composable
fun MainBottomBar(
Expand Down Expand Up @@ -83,7 +87,8 @@ fun MainBottomBar(
MainNavigationBarItem(
selected = tab == currentTab,
tab = tab,
onClick = { onTabSelected(tab) }
onClick = { onTabSelected(tab) },
modifier = Modifier.weight(1f)
)
}
}
Expand All @@ -108,7 +113,7 @@ private fun MainNavigationBarItem(
Column(
modifier = modifier
.noRippleClickable(onClick)
.padding(horizontal = 12.dp, vertical = 8.dp),
.padding(vertical = 8.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Expand All @@ -127,4 +132,34 @@ private fun MainNavigationBarItem(
textAlign = TextAlign.Center
)
}
}

@Preview(name = "Parent Mode")
@Composable
private fun PreviewMainBottomBarParent() {
KieroTheme {
MainBottomBar(
isVisible = true,
isParentMode = true,
containerShape = RoundedCornerShape(12.dp),
tabs = persistentListOf(*ParentMainTab.entries.toTypedArray()),
currentTab = ParentMainTab.SCHEDULE,
onTabSelected = {}
)
}
}

@Preview(name = "Kid Mode")
@Composable
private fun PreviewMainBottomBarKid() {
KieroTheme {
MainBottomBar(
isVisible = true,
isParentMode = false,
containerShape = RoundedCornerShape(12.dp),
tabs = persistentListOf(*KidMainTab.entries.toTypedArray()),
currentTab = KidMainTab.MISSION,
onTabSelected = {}
)
}
}
Loading