diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 4a72748e..fc333ade 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,6 +16,7 @@ + diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt index 35ea7a06..e28c11b0 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt @@ -53,6 +53,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappSubTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.management.event.R import com.wap.wapp.feature.management.event.edit.EventEditViewModel.EventEditEvent import com.wap.wapp.feature.management.event.registration.EventRegistrationContent @@ -84,9 +85,6 @@ internal fun EventEditRoute( val onStartTimeChanged = viewModel::setEventStartTime val onEndDateChanged = viewModel::setEventEndDate val onEndTimeChanged = viewModel::setEventEndTime - val onNextButtonClicked = - viewModel::setEventRegistrationState - val onRegisterButtonClicked = viewModel::updateEvent LaunchedEffect(true) { viewModel.getEvent(eventId = eventId) @@ -125,10 +123,19 @@ internal fun EventEditRoute( onStartTimeChanged = onStartTimeChanged, onEndDateChanged = onEndDateChanged, onEndTimeChanged = onEndTimeChanged, - onNextButtonClicked = onNextButtonClicked, - onEditButtonClicked = onRegisterButtonClicked, - onBackButtonClicked = navigateToManagement, + onNextButtonClicked = { currentState, nextState -> + if (viewModel.validateEvent(currentState)) { + viewModel.setEventRegistrationState(nextState) + } + }, + onCloseButtonClicked = navigateToManagement, + onPreviousButtonClicked = viewModel::setEventRegistrationState, deleteEvent = viewModel::deleteEvent, + onEditButtonClicked = { lastState -> + if (viewModel.validateEvent(lastState)) { + viewModel.updateEvent() + } + }, ) } @@ -151,9 +158,10 @@ internal fun EventEditScreen( onStartTimeChanged: (LocalTime) -> Unit, onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, - onNextButtonClicked: () -> Unit, - onEditButtonClicked: () -> Unit, - onBackButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onEditButtonClicked: (EventRegistrationState) -> Unit, + onCloseButtonClicked: () -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, deleteEvent: () -> Unit, ) { var showStartDatePicker by remember { mutableStateOf(false) } @@ -190,7 +198,8 @@ internal fun EventEditScreen( titleRes = R.string.event_edit, showLeftButton = true, showRightButton = true, - onClickLeftButton = onBackButtonClicked, + leftButtonDrawableRes = drawable.ic_close, + onClickLeftButton = onCloseButtonClicked, onClickRightButton = { showDeleteEventDialog = true }, ) @@ -201,7 +210,7 @@ internal fun EventEditScreen( EventRegistrationContent( eventRegistrationState = currentEditState, - modifier = Modifier.padding(top = 50.dp, start = 20.dp, end = 20.dp), + modifier = Modifier.padding(horizontal = 20.dp), eventTitle = title, eventContent = content, location = location, @@ -229,6 +238,7 @@ internal fun EventEditScreen( onEndTimePickerStateChanged = { state -> showEndTimePicker = state }, onNextButtonClicked = onNextButtonClicked, onRegisterButtonClicked = onEditButtonClicked, + onPreviousButtonClicked = onPreviousButtonClicked, ) } } diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt index 74ed8604..b9455d2b 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt @@ -84,46 +84,53 @@ class EventEditViewModel @Inject constructor( _eventEndTime.value = eventTime } - fun setEventRegistrationState() { - if (_currentEditState.value == EventRegistrationState.EVENT_DETAILS) { - if (!isValidTitle()) { - emitValidationErrorMessage("행사 이름을 입력하세요.") - return + fun validateEvent(eventRegistrationState: EventRegistrationState): Boolean { + when (eventRegistrationState) { + EventRegistrationState.EVENT_DETAILS -> { + if (!isValidTitle()) { + emitValidationErrorMessage("행사 이름을 입력하세요.") + return false + } + + if (!isValidContent()) { + emitValidationErrorMessage("행사 내용을 입력하세요.") + return false + } } - if (!isValidContent()) { - emitValidationErrorMessage("행사 내용을 입력하세요.") - return + + EventRegistrationState.EVENT_SCHEDULE -> { + if (!isValidLocation()) { + emitValidationErrorMessage("장소를 입력하세요.") + return false + } + + if (!isValidEndTime(_eventEndTime.value)) { + emitValidationErrorMessage("일정 종료는 시작보다 늦어야 합니다.") + return false + } } - _currentEditState.value = EventRegistrationState.EVENT_SCHEDULE } + return true } - fun updateEvent() { - if (!isValidLocation()) { - emitValidationErrorMessage("장소를 입력하세요.") - return - } - - if (!isValidEndTime(_eventEndTime.value)) { - emitValidationErrorMessage("일정 종료는 시작보다 늦어야 합니다.") - return - } + fun setEventRegistrationState(eventRegistrationState: EventRegistrationState) { + _currentEditState.value = eventRegistrationState + } - viewModelScope.launch { - updateEventUseCase( - eventTitle = _eventTitle.value, - eventContent = _eventContent.value, - eventLocation = _eventLocation.value, - eventStartDate = _eventStartDate.value, - eventStartTime = _eventStartTime.value, - eventEndDate = _eventEndDate.value, - eventEndTime = _eventEndTime.value, - eventId = _eventId.value, - ).onSuccess { - _eventEditEvent.emit(EventEditEvent.EditSuccess) - }.onFailure { throwable -> - _eventEditEvent.emit(EventEditEvent.Failure(throwable)) - } + fun updateEvent() = viewModelScope.launch { + updateEventUseCase( + eventTitle = _eventTitle.value, + eventContent = _eventContent.value, + eventLocation = _eventLocation.value, + eventStartDate = _eventStartDate.value, + eventStartTime = _eventStartTime.value, + eventEndDate = _eventEndDate.value, + eventEndTime = _eventEndTime.value, + eventId = _eventId.value, + ).onSuccess { + _eventEditEvent.emit(EventEditEvent.EditSuccess) + }.onFailure { throwable -> + _eventEditEvent.emit(EventEditEvent.Failure(throwable)) } } @@ -136,15 +143,13 @@ class EventEditViewModel @Inject constructor( } private fun isValidEndTime(eventTime: LocalTime): Boolean { - if (_eventEndDate.value > _eventStartDate.value) { - return true - } + val startDate = _eventStartDate.value + val endDate = _eventEndDate.value - if (_eventEndDate.value == _eventStartDate.value && eventTime > _eventStartTime.value) { - return true + if (startDate == endDate) { + return eventTime > _eventStartTime.value } - - return false + return startDate < endDate } private fun isValidEndDate(eventDate: LocalDate): Boolean = eventDate >= _eventStartDate.value diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt index ba42dad1..c304cbd9 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt @@ -69,8 +69,9 @@ internal fun EventRegistrationContent( onStartTimePickerStateChanged: (Boolean) -> Unit, onEndDatePickerStateChanged: (Boolean) -> Unit, onEndTimePickerStateChanged: (Boolean) -> Unit, - onNextButtonClicked: () -> Unit, - onRegisterButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onRegisterButtonClicked: (EventRegistrationState) -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, ) { val coroutineScope = rememberCoroutineScope() val focusManager = LocalFocusManager.current @@ -78,7 +79,8 @@ internal fun EventRegistrationContent( Column( modifier = modifier .fillMaxSize() - .addFocusCleaner(focusManager), + .addFocusCleaner(focusManager) + .padding(top = 40.dp), ) { AnimatedContent( targetState = eventRegistrationState, @@ -91,6 +93,7 @@ internal fun EventRegistrationContent( slideOutHorizontally(targetOffsetX = { it }) + fadeOut() } }, + label = stringResource(R.string.event_registration_content_navigation_animated_label), ) { eventState -> when (eventState) { EventRegistrationState.EVENT_DETAILS -> EventDetailsContent( @@ -102,7 +105,10 @@ internal fun EventRegistrationContent( coroutineScope.launch { scrollState.scrollTo(0) } - onNextButtonClicked() + onNextButtonClicked( + EventRegistrationState.EVENT_DETAILS, // current State + EventRegistrationState.EVENT_SCHEDULE, // next Stae + ) }, ) @@ -127,7 +133,12 @@ internal fun EventRegistrationContent( onStartTimePickerStateChanged = onStartTimePickerStateChanged, onEndDatePickerStateChanged = onEndDatePickerStateChanged, onEndTimePickerStateChanged = onEndTimePickerStateChanged, - onRegisterButtonClicked = onRegisterButtonClicked, + onRegisterButtonClicked = { + onRegisterButtonClicked(EventRegistrationState.EVENT_SCHEDULE) + }, + onPreviousButtonClicked = { + onPreviousButtonClicked(EventRegistrationState.EVENT_DETAILS) + }, ) } } @@ -214,6 +225,7 @@ private fun EventScheduleContent( onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, onRegisterButtonClicked: () -> Unit, + onPreviousButtonClicked: () -> Unit, ) { if (showEndDatePicker) { WappDatePickerDialog( @@ -328,10 +340,21 @@ private fun EventScheduleContent( Spacer(modifier = Modifier.weight(1f)) - WappButton( - onClick = onRegisterButtonClicked, - textRes = R.string.register_event, - ) + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + ) { + WappButton( + textRes = R.string.previous, + onClick = onPreviousButtonClicked, + modifier = Modifier.weight(1f), + ) + + WappButton( + textRes = R.string.register_event, + onClick = onRegisterButtonClicked, + modifier = Modifier.weight(1f), + ) + } } } } diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt index b21397f9..ebeb1bed 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt @@ -37,6 +37,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappSubTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.management.event.R import kotlinx.coroutines.flow.collectLatest import java.time.LocalDate @@ -64,9 +65,6 @@ internal fun EventRegistrationRoute( val onStartTimeChanged = viewModel::setEventStartTime val onEndDateChanged = viewModel::setEventEndDate val onEndTimeChanged = viewModel::setEventEndTime - val onNextButtonClicked = - viewModel::setEventRegistrationState - val onRegisterButtonClicked = viewModel::registerEvent LaunchedEffect(true) { viewModel.eventRegistrationEvent.collectLatest { @@ -99,9 +97,18 @@ internal fun EventRegistrationRoute( onStartTimeChanged = onStartTimeChanged, onEndDateChanged = onEndDateChanged, onEndTimeChanged = onEndTimeChanged, - onNextButtonClicked = onNextButtonClicked, - onRegisterButtonClicked = onRegisterButtonClicked, - onBackButtonClicked = navigateToManagement, + onNextButtonClicked = { currentState, nextState -> + if (viewModel.validateEvent(currentState)) { + viewModel.setEventRegistrationState(nextState) + } + }, + onCloseButtonClicked = navigateToManagement, + onPreviousButtonClicked = viewModel::setEventRegistrationState, + onRegisterButtonClicked = { lastState -> + if (viewModel.validateEvent(lastState)) { // 마지막 상태 대입 + viewModel.registerEvent() + } + }, ) } @@ -124,9 +131,10 @@ internal fun EventRegistrationScreen( onStartTimeChanged: (LocalTime) -> Unit, onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, - onNextButtonClicked: () -> Unit, - onRegisterButtonClicked: () -> Unit, - onBackButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, + onRegisterButtonClicked: (EventRegistrationState) -> Unit, + onCloseButtonClicked: () -> Unit, ) { var showStartDatePicker by remember { mutableStateOf(false) } var showStartTimePicker by remember { mutableStateOf(false) } @@ -154,7 +162,8 @@ internal fun EventRegistrationScreen( WappSubTopBar( titleRes = R.string.event_registration, showLeftButton = true, - onClickLeftButton = onBackButtonClicked, + onClickLeftButton = onCloseButtonClicked, + leftButtonDrawableRes = drawable.ic_close, ) EventRegistrationStateIndicator( @@ -164,8 +173,7 @@ internal fun EventRegistrationScreen( EventRegistrationContent( eventRegistrationState = currentRegistrationState, - modifier = Modifier - .padding(top = 50.dp, start = 20.dp, end = 20.dp, bottom = 20.dp), + modifier = Modifier.padding(horizontal = 20.dp), eventTitle = title, eventContent = content, location = location, @@ -192,6 +200,7 @@ internal fun EventRegistrationScreen( onEndDatePickerStateChanged = { state -> showEndDatePicker = state }, onEndTimePickerStateChanged = { state -> showEndTimePicker = state }, onNextButtonClicked = onNextButtonClicked, + onPreviousButtonClicked = onPreviousButtonClicked, onRegisterButtonClicked = onRegisterButtonClicked, ) } @@ -241,6 +250,7 @@ private fun EventRegistrationStateProgressBar( stiffness = Spring.StiffnessMediumLow, dampingRatio = Spring.DampingRatioMediumBouncy, ), + label = stringResource(R.string.event_registration_state_progress_animation), ) LinearProgressIndicator( diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt index 72972ad7..60a65baf 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt @@ -62,7 +62,7 @@ class EventRegistrationViewModel @Inject constructor( fun setEventStartDate(eventDate: LocalDate) { if (!isValidStartDate(eventDate)) { - emitValidationErrorMessage("최소 하루 이상 일정 날짜를 지정 하세요.") + emitValidationErrorMessage("최소 하루 이상 일정 날짜를 지정하세요.") return } _eventStartDate.value = eventDate @@ -86,56 +86,62 @@ class EventRegistrationViewModel @Inject constructor( _eventEndTime.value = eventTime } - fun setEventRegistrationState() { - if (_currentRegistrationState.value == EVENT_DETAILS) { - if (!isValidTitle()) { - emitValidationErrorMessage("행사 이름을 입력 하세요.") - return + fun validateEvent(eventRegistrationState: EventRegistrationState): Boolean { + when (eventRegistrationState) { + EVENT_DETAILS -> { + if (!isValidTitle()) { + emitValidationErrorMessage("행사 이름을 입력하세요.") + return false + } + + if (!isValidContent()) { + emitValidationErrorMessage("행사 내용을 입력하세요.") + return false + } } - if (!isValidContent()) { - emitValidationErrorMessage("행사 내용을 입력 하세요.") - return + + EVENT_SCHEDULE -> { + if (!isValidLocation()) { + emitValidationErrorMessage("장소를 입력하세요.") + return false + } + if (!isValidEndTime(_eventEndTime.value)) { + emitValidationErrorMessage("일정 종료는 시작보다 늦어야 합니다.") + return false + } } - _currentRegistrationState.value = EVENT_SCHEDULE } + return true } - fun registerEvent() { - if (!isValidLocation()) { - emitValidationErrorMessage("장소를 입력 하세요.") - return - } - - if (!isValidEndTime(_eventEndTime.value)) { - emitValidationErrorMessage("일정 종료는 시작보다 늦어야 합니다.") - return - } + fun setEventRegistrationState(eventRegistrationState: EventRegistrationState) { + _currentRegistrationState.value = eventRegistrationState + } - viewModelScope.launch { - postEventUseCase( - eventTitle = _eventTitle.value, - eventContent = _eventContent.value, - eventLocation = _eventLocation.value, - eventStartDate = _eventStartDate.value, - eventStartTime = _eventStartTime.value, - eventEndDate = _eventEndDate.value, - eventEndTime = _eventEndTime.value, - ).onSuccess { - _eventRegistrationEvent.emit(EventRegistrationEvent.Success) - }.onFailure { throwable -> - _eventRegistrationEvent.emit(EventRegistrationEvent.Failure(throwable)) - } + fun registerEvent() = viewModelScope.launch { + postEventUseCase( + eventTitle = _eventTitle.value, + eventContent = _eventContent.value, + eventLocation = _eventLocation.value, + eventStartDate = _eventStartDate.value, + eventStartTime = _eventStartTime.value, + eventEndDate = _eventEndDate.value, + eventEndTime = _eventEndTime.value, + ).onSuccess { + _eventRegistrationEvent.emit(EventRegistrationEvent.Success) + }.onFailure { throwable -> + _eventRegistrationEvent.emit(EventRegistrationEvent.Failure(throwable)) } } private fun isValidEndTime(eventTime: LocalTime): Boolean { - if (_eventEndDate.value > _eventStartDate.value) { - return true - } - if (_eventEndDate.value == _eventStartDate.value && eventTime > _eventStartTime.value) { - return true + val startDate = _eventStartDate.value + val endDate = _eventEndDate.value + + if (startDate == endDate) { + return eventTime > _eventStartTime.value } - return false + return startDate < endDate } private fun isValidEndDate(eventDate: LocalDate): Boolean = eventDate >= _eventStartDate.value diff --git a/feature/management-event/src/main/res/values/strings.xml b/feature/management-event/src/main/res/values/strings.xml index 27ba1196..5e70a1b9 100644 --- a/feature/management-event/src/main/res/values/strings.xml +++ b/feature/management-event/src/main/res/values/strings.xml @@ -29,4 +29,7 @@ 선택 "이전 달을 보여주는 화살표 입니다." "다음 달을 보여주는 화살표 입니다." + 이전 + Event Registration Content Navigation Animated Label + Event Registration State Progress Animation diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt index 3ab0a169..bd066b8a 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt @@ -79,7 +79,7 @@ internal fun SurveyDeadlineContent( WappTitle( title = stringResource(R.string.survey_deadline_title), content = stringResource(R.string.survey_deadline_content), - modifier = Modifier.padding(top = 10.dp, bottom = 20.dp), + modifier = Modifier.padding(bottom = 20.dp), ) DeadlineCard( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt index 070bbf85..3a0bf294 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt @@ -33,14 +33,14 @@ internal fun SurveyEventContent( WappTitle( title = stringResource(R.string.event_selection_title), content = stringResource(R.string.event_selection_content), - modifier = Modifier.padding(top = 10.dp, bottom = 40.dp), + modifier = Modifier.padding(bottom = 40.dp), ) LazyColumn( verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier .fillMaxWidth() - .weight(1f), + .weight(1f) ) { when (eventsState) { is EventsState.Loading -> item { diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt index f9498a28..b56bf362 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt @@ -9,6 +9,7 @@ import androidx.compose.animation.togetherWith import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.TimePickerState import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource import com.wap.wapp.core.model.event.Event import com.wap.wapp.core.model.survey.QuestionType import java.time.LocalDate @@ -59,6 +60,7 @@ internal fun SurveyFormContent( slideOutHorizontally(targetOffsetX = { it }) + fadeOut() } }, + label = stringResource(R.string.survey_form_registration_content_animated_content), ) { registrationState -> when (registrationState) { SurveyFormState.EVENT_SELECTION -> { diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt index e51cb3b3..83be22aa 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt @@ -38,7 +38,7 @@ internal fun SurveyInformationContent( WappTitle( title = stringResource(R.string.survey_information_title), content = stringResource(R.string.survey_information_content), - modifier = Modifier.padding(top = 10.dp, bottom = 24.dp), + modifier = Modifier.padding(bottom = 24.dp), ) Text( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt index 076036df..252778aa 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt @@ -62,7 +62,7 @@ internal fun SurveyQuestionContent( WappTitle( title = stringResource(R.string.survey_question_title), content = stringResource(R.string.survey_question_content), - modifier = Modifier.padding(top = 10.dp, bottom = 30.dp), + modifier = Modifier.padding(bottom = 30.dp), ) Row( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt index fcbb07e0..0d339caf 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt @@ -103,7 +103,7 @@ internal fun SurveyFormEditScreen( .addFocusCleaner(focusManager) .padding(paddingValues) // paddingValue padding .padding(vertical = 16.dp, horizontal = 20.dp), // dp value padding - verticalArrangement = Arrangement.spacedBy(20.dp), + verticalArrangement = Arrangement.spacedBy(40.dp), ) { if (showDeleteSurveyDialog) { DeleteSurveyDialog( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt index 28755901..662ee62d 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt @@ -93,12 +93,9 @@ internal fun SurveyRegistrationScreen( .fillMaxSize() .padding(paddingValues) .padding(vertical = 16.dp, horizontal = 20.dp), - verticalArrangement = Arrangement.spacedBy(20.dp), + verticalArrangement = Arrangement.spacedBy(40.dp), ) { - SurveyFormStateIndicator( - surveyRegistrationState = currentRegistrationState, - modifier = Modifier.padding(horizontal = 20.dp), - ) + SurveyFormStateIndicator(surveyRegistrationState = currentRegistrationState) SurveyFormContent( surveyRegistrationState = currentRegistrationState, diff --git a/feature/management-survey/src/main/res/values/strings.xml b/feature/management-survey/src/main/res/values/strings.xml index 4bd9bc11..a4d65389 100644 --- a/feature/management-survey/src/main/res/values/strings.xml +++ b/feature/management-survey/src/main/res/values/strings.xml @@ -50,4 +50,5 @@ 이전 다음 질문 이전 질문 + Survey Form Registration Content Animated Content diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt index 5adc920f..6191326c 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.wap.designsystem.component.WappButton import com.wap.designsystem.modifier.addFocusCleaner @@ -59,6 +60,7 @@ internal fun SurveyAnswerForm( slideOutHorizontally(targetOffsetX = { it }) + fadeOut() } }, + label = stringResource(R.string.survey_answer_form_animated_content_label), ) { questionNumber -> Column { when (surveyForm.surveyQuestionList[questionNumber].questionType) { @@ -91,9 +93,9 @@ internal fun SurveyAnswerForm( modifier = Modifier.weight(1f), ) - SurveyAnswerButton( - isLastQuestion = isLastQuestion, - onButtonClicked = onNextQuestionButtonClicked, + WappButton( + textRes = if (isLastQuestion) R.string.submit else R.string.next, + onClick = { onNextQuestionButtonClicked() }, isEnabled = checkQuestionTypeAndSubjectiveAnswer( questionType = surveyQuestion.questionType, subjectiveAnswer = subjectiveAnswer, @@ -106,30 +108,6 @@ internal fun SurveyAnswerForm( } } -@Composable -private fun SurveyAnswerButton( - isLastQuestion: Boolean, - isEnabled: Boolean, - onButtonClicked: () -> Unit, - modifier: Modifier, -) { - if (isLastQuestion) { - WappButton( - textRes = R.string.submit, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } else { - WappButton( - textRes = R.string.next, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } -} - private fun checkQuestionTypeAndSubjectiveAnswer( questionType: QuestionType, subjectiveAnswer: String, diff --git a/feature/survey/src/main/res/values/strings.xml b/feature/survey/src/main/res/values/strings.xml index ec1e9641..91b38642 100644 --- a/feature/survey/src/main/res/values/strings.xml +++ b/feature/survey/src/main/res/values/strings.xml @@ -21,4 +21,5 @@ 행사 마감일 질문 수 + SurveyAnswerForm Navigation