diff --git a/app/instructor/src/main/java/com/ssing/instructor/InstructorMainNavHost.kt b/app/instructor/src/main/java/com/ssing/instructor/InstructorMainNavHost.kt index 5d4fd555..6867a4dd 100644 --- a/app/instructor/src/main/java/com/ssing/instructor/InstructorMainNavHost.kt +++ b/app/instructor/src/main/java/com/ssing/instructor/InstructorMainNavHost.kt @@ -91,6 +91,12 @@ internal fun InstructorMainNavHost( navigateToMatching = { navController.navigate(route = InstructorMatching()) }, + navigateToHome = { + navController.navigate( + route = InstructorHome, + navOptions = navController.clearBackStackNavOptions(), + ) + } ) instructorProfileNavGraph( paddingValues = paddingValues, diff --git a/core/notification/src/main/java/com/ssing/core/notification/PushNotificationService.kt b/core/notification/src/main/java/com/ssing/core/notification/PushNotificationService.kt index 44c1007a..bcea4dd8 100644 --- a/core/notification/src/main/java/com/ssing/core/notification/PushNotificationService.kt +++ b/core/notification/src/main/java/com/ssing/core/notification/PushNotificationService.kt @@ -82,7 +82,7 @@ class PushNotificationService : FirebaseMessagingService() { ) } val notification = NotificationCompat.Builder(this, DEFAULT_CHANNEL_ID) - .setSmallIcon(android.R.drawable.ic_dialog_info) + .setSmallIcon(R.drawable.ic_stat_name) .setContentTitle(title) .setContentText(body) .apply { pendingIntent?.let { setContentIntent(it) } } diff --git a/core/notification/src/main/res/drawable-hdpi/ic_stat_name.png b/core/notification/src/main/res/drawable-hdpi/ic_stat_name.png new file mode 100644 index 00000000..dca735eb Binary files /dev/null and b/core/notification/src/main/res/drawable-hdpi/ic_stat_name.png differ diff --git a/core/notification/src/main/res/drawable-mdpi/ic_stat_name.png b/core/notification/src/main/res/drawable-mdpi/ic_stat_name.png new file mode 100644 index 00000000..3a69d15b Binary files /dev/null and b/core/notification/src/main/res/drawable-mdpi/ic_stat_name.png differ diff --git a/core/notification/src/main/res/drawable-xhdpi/ic_stat_name.png b/core/notification/src/main/res/drawable-xhdpi/ic_stat_name.png new file mode 100644 index 00000000..ffddee08 Binary files /dev/null and b/core/notification/src/main/res/drawable-xhdpi/ic_stat_name.png differ diff --git a/core/notification/src/main/res/drawable-xxhdpi/ic_stat_name.png b/core/notification/src/main/res/drawable-xxhdpi/ic_stat_name.png new file mode 100644 index 00000000..ed494fb4 Binary files /dev/null and b/core/notification/src/main/res/drawable-xxhdpi/ic_stat_name.png differ diff --git a/core/notification/src/main/res/drawable-xxxhdpi/ic_stat_name.png b/core/notification/src/main/res/drawable-xxxhdpi/ic_stat_name.png new file mode 100644 index 00000000..442ae345 Binary files /dev/null and b/core/notification/src/main/res/drawable-xxxhdpi/ic_stat_name.png differ diff --git a/core/ui/src/main/java/com/ssing/core/ui/common/component/SsingBottomBar.kt b/core/ui/src/main/java/com/ssing/core/ui/common/component/SsingBottomBar.kt index 55304db6..f545ebdf 100644 --- a/core/ui/src/main/java/com/ssing/core/ui/common/component/SsingBottomBar.kt +++ b/core/ui/src/main/java/com/ssing/core/ui/common/component/SsingBottomBar.kt @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text @@ -99,10 +100,6 @@ private fun SsingBottomBarItem( Column( modifier = modifier - .background( - color = if (isPressed) SSINGTheme.colors.borderDisabled else Color.Transparent, - shape = RoundedCornerShape(12.dp), - ) .clickable( interactionSource = interactionSource, indication = null, @@ -111,15 +108,25 @@ private fun SsingBottomBarItem( .padding(top = 8.dp, bottom = 12.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { - Icon( - imageVector = ImageVector.vectorResource(iconRes), - contentDescription = stringResource(tab.titleRes), - tint = textColor, - ) - Text( - text = stringResource(tab.titleRes), - style = SSINGTheme.typography.caption.md11, - color = textColor, - ) + Column( + modifier = Modifier + .widthIn(min = 40.dp) + .background( + color = if (isPressed) SSINGTheme.colors.borderDisabled else Color.Transparent, + shape = RoundedCornerShape(12.dp), + ), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Icon( + imageVector = ImageVector.vectorResource(iconRes), + contentDescription = stringResource(tab.titleRes), + tint = textColor, + ) + Text( + text = stringResource(tab.titleRes), + style = SSINGTheme.typography.caption.md11, + color = textColor, + ) + } } } diff --git a/presentation/consumer-matching/src/main/java/com/ssing/presentation/consumermatching/screen/ConsumerMatchingPendingScreen.kt b/presentation/consumer-matching/src/main/java/com/ssing/presentation/consumermatching/screen/ConsumerMatchingPendingScreen.kt index 64f10ccd..adf7df4d 100644 --- a/presentation/consumer-matching/src/main/java/com/ssing/presentation/consumermatching/screen/ConsumerMatchingPendingScreen.kt +++ b/presentation/consumer-matching/src/main/java/com/ssing/presentation/consumermatching/screen/ConsumerMatchingPendingScreen.kt @@ -156,7 +156,6 @@ internal fun ConsumerMatchingPendingScreen( tags = state.tags, location = state.location, duration = state.duration, - price = state.price, equipmentStatus = "착용 완료", borderColor = SSINGTheme.colors.borderAlternative, ) diff --git a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailContract.kt b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailContract.kt index c187988b..35b6c567 100644 --- a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailContract.kt +++ b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailContract.kt @@ -5,49 +5,20 @@ import com.ssing.presentation.instructorlessondetail.model.LessonDetailBeforeUiM import com.ssing.presentation.instructorlessondetail.model.LessonDetailCanceledUiModel import com.ssing.presentation.instructorlessondetail.model.LessonDetailCompletedUiModel import com.ssing.presentation.instructorlessondetail.model.LessonDetailOngoingUiModel -import com.ssing.presentation.instructorlessondetail.model.TeamParticipantsInfo import com.ssing.presentation.instructorlessondetail.screen.CancelReasonState -import kotlinx.collections.immutable.persistentListOf internal interface LessonDetailContract { @Immutable data class State( - val phase: LessonDetailPhase = LessonDetailPhase.LessonDetailBefore( - before = LessonDetailBeforeUiModel( - isInstructorReady = false, - participantReadyCount = 2, - participantTotalCount = 5, - tags = persistentListOf("스노보드", "자격증이 있어요"), - classTitle = "김OO님 팀, 홍지민님 팀 총 5명", - location = "OOO 리조트", - duration = "0시간", - price = 0, - teams = persistentListOf( - TeamParticipantsInfo( - teamNickname = "김OO", - teamCount = 0, - participants = persistentListOf("38세 남", "12세 여", "9세 남"), - price = 0, - isReady = true, - ), - TeamParticipantsInfo( - teamNickname = "김OO", - teamCount = 0, - participants = persistentListOf("38세 남", "12세 여", "9세 남"), - price = 0, - isReady = false, - ), - ), - ), - ), + val phase: LessonDetailPhase = LessonDetailPhase.LessonDetailInit, val showReadyDialog: Boolean = false, val showLessonEndDialog: Boolean = false, val cancelReasonState: CancelReasonState = CancelReasonState(), ) sealed interface LessonDetailPhase { - data object Loading : LessonDetailPhase + data object LessonDetailInit : LessonDetailPhase data class LessonDetailBefore(val before: LessonDetailBeforeUiModel) : LessonDetailPhase data class LessonDetailOngoing(val ongoing: LessonDetailOngoingUiModel) : LessonDetailPhase data class LessonDetailCompleted(val completed: LessonDetailCompletedUiModel) : @@ -62,7 +33,7 @@ internal interface LessonDetailContract { } sealed interface Effect { - data object NavigateBack : Effect + data object NavigateToHome : Effect data object NavigateToMatching : Effect data class ShowToast(val message: String) : Effect } diff --git a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailViewModel.kt b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailViewModel.kt index 3182dbe7..275f81a3 100644 --- a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailViewModel.kt +++ b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/LessonDetailViewModel.kt @@ -88,8 +88,6 @@ internal class LessonDetailViewModel @Inject constructor( } private fun loadLessonDetail() { - updateState { copy(phase = LessonDetailContract.LessonDetailPhase.Loading) } - viewModelScope.launch { instructorLessonDetailRepository.fetchInstructorLessonDetail(lessonId) .onSuccess { result -> @@ -117,12 +115,12 @@ internal class LessonDetailViewModel @Inject constructor( if (it is ApiException) { sendEffect(LessonDetailContract.Effect.ShowToast(it.uiMessage)) } - sendEffect(LessonDetailContract.Effect.NavigateBack) + sendEffect(LessonDetailContract.Effect.NavigateToHome) } } } - fun onBackClick() = sendEffect(LessonDetailContract.Effect.NavigateBack) + fun onBackClick() = sendEffect(LessonDetailContract.Effect.NavigateToHome) fun onMatchingClick() = sendEffect(LessonDetailContract.Effect.NavigateToMatching) diff --git a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/navigation/InstructorLessonNavigation.kt b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/navigation/InstructorLessonNavigation.kt index dbc80240..762f3303 100644 --- a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/navigation/InstructorLessonNavigation.kt +++ b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/navigation/InstructorLessonNavigation.kt @@ -10,12 +10,13 @@ import com.ssing.presentation.instructorlessondetail.screen.LessonDetailRoute import kotlinx.serialization.Serializable @Serializable -data class InstructorLesson(val lessonId :Long): Route +data class InstructorLesson(val lessonId: Long) : Route fun NavGraphBuilder.instructorLessonNavGraph( paddingValues: PaddingValues, navController: NavController, navigateToMatching: () -> Unit, + navigateToHome: () -> Unit, ) { composable( deepLinks = listOf( @@ -24,6 +25,7 @@ fun NavGraphBuilder.instructorLessonNavGraph( ) { LessonDetailRoute( navigateBack = navController::popBackStack, + navigateToHome = navigateToHome, navigateToMatching = navigateToMatching, ) } diff --git a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/screen/LessonDetailScreen.kt b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/screen/LessonDetailScreen.kt index 2abded92..4100dcd6 100644 --- a/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/screen/LessonDetailScreen.kt +++ b/presentation/instructor-lesson/src/main/java/com/ssing/presentation/instructorlessondetail/screen/LessonDetailScreen.kt @@ -1,5 +1,6 @@ package com.ssing.presentation.instructorlessondetail.screen +import androidx.activity.compose.BackHandler import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier @@ -19,6 +20,7 @@ import com.ssing.presentation.instructorlessondetail.LessonDetailViewModel internal fun LessonDetailRoute( navigateBack: () -> Unit, navigateToMatching: () -> Unit, + navigateToHome: () -> Unit, modifier: Modifier = Modifier, viewModel: LessonDetailViewModel = hiltViewModel(), ) { @@ -28,11 +30,19 @@ internal fun LessonDetailRoute( HandleUiEffects(viewModel.uiEffect) { effect -> when (effect) { is LessonDetailContract.Effect.ShowToast -> context.toast(effect.message) - LessonDetailContract.Effect.NavigateBack -> navigateBack() + LessonDetailContract.Effect.NavigateToHome -> navigateToHome() LessonDetailContract.Effect.NavigateToMatching -> navigateToMatching() } } + BackHandler { + when { + state.showReadyDialog -> viewModel.onReadyDialogDismiss() + state.showLessonEndDialog -> viewModel.onLessonEndDialogDismiss() + else -> navigateToHome() + } + } + LessonDetailScreen( state = state, onBackClick = viewModel::onBackClick, @@ -76,7 +86,7 @@ private fun LessonDetailScreen( modifier: Modifier = Modifier, ) { when (val phase = state.phase) { - is LessonDetailPhase.Loading -> {} + is LessonDetailPhase.LessonDetailInit -> {} is LessonDetailPhase.LessonDetailBefore -> LessonDetailBeforeScreen( before = phase.before,