From 04ebdcad3c79f7e84eb0673375aaf1997dcc0004 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:26:47 +0900 Subject: [PATCH 001/102] =?UTF-8?q?[FEATURE]=20#106=20:=20=EC=98=A4?= =?UTF-8?q?=EB=8A=98=20=EC=9D=BC=EC=A0=95=EC=9D=B4=20=EC=9E=88=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0,=20=EC=B6=9C=EC=84=9D=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=97=90=20=ED=85=8C=EB=91=90=EB=A6=AC=EA=B0=80=20=EC=83=9D?= =?UTF-8?q?=EA=B8=B0=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/wapp/navigation/WappNavHost.kt | 2 +- .../feature/management/ManagementScreen.kt | 3 +-- .../wap/wapp/feature/profile/ProfileScreen.kt | 2 ++ .../profilesetting/component/UserProfile.kt | 27 ++++++++++++++++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt index 4405e4f0..b94afe59 100644 --- a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt +++ b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt @@ -123,7 +123,7 @@ fun WappNavHost( navigateToEventRegistration = navController::navigateToEventRegistration, navigateToEventEdit = navController::navigateToEventEdit, navigateToSurveyFormEdit = navController::navigateToSurveyFormEdit, - navigateToSignIn = navController::navigateToSignIn + navigateToSignIn = navController::navigateToSignIn, ) } } diff --git a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt index facce7ad..b2c43725 100644 --- a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt +++ b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt @@ -8,7 +8,6 @@ import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -68,7 +67,7 @@ internal fun ManagementRoute( onValidationSuccess = { showValidationScreen = false viewModel.getUserRole() // 매니저 권한 재 검증 - } + }, ) return } diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt index fc3383eb..b9d9c0e4 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt @@ -132,6 +132,7 @@ internal fun ProfileScreen( todayEventsState = todayEventsState, recentEventsState = recentEventsState, userRespondedSurveysState = userRespondedSurveysState, + attendanceCardBoardColor = WappTheme.colors.blue4FF, ) } @@ -154,6 +155,7 @@ internal fun ProfileScreen( todayEventsState = todayEventsState, recentEventsState = recentEventsState, userRespondedSurveysState = userRespondedSurveysState, + attendanceCardBoardColor = WappTheme.colors.yellow34, ) } diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt index 00fc9949..bbbdefb5 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt @@ -1,6 +1,8 @@ package com.wap.wapp.feature.profile.profilesetting.component import androidx.compose.foundation.Image +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -11,10 +13,12 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.SpanStyle @@ -40,10 +44,12 @@ internal fun UserProfile( todayEventsState: ProfileViewModel.EventsState, recentEventsState: ProfileViewModel.EventsState, userRespondedSurveysState: ProfileViewModel.SurveysState, + attendanceCardBoardColor: Color, ) { Column(modifier = Modifier.padding(horizontal = 10.dp)) { ProfileAttendanceCard( todayEventsState = todayEventsState, + attendanceCardBoardColor = attendanceCardBoardColor, modifier = Modifier.padding(top = 20.dp), ) @@ -62,15 +68,30 @@ internal fun UserProfile( @Composable private fun ProfileAttendanceCard( todayEventsState: ProfileViewModel.EventsState, + attendanceCardBoardColor: Color, modifier: Modifier, ) { when (todayEventsState) { is ProfileViewModel.EventsState.Loading -> CircleLoader(modifier = Modifier.fillMaxSize()) is ProfileViewModel.EventsState.Success -> { - WappCard( - modifier = modifier + val cardModifier = if (todayEventsState.events.isNotEmpty()) { + modifier + .border( + width = 2.dp, + color = attendanceCardBoardColor, + shape = RoundedCornerShape(10.dp), + ) + .fillMaxWidth() + .wrapContentHeight() + .clickable { } + } else { + modifier .fillMaxWidth() - .wrapContentHeight(), + .wrapContentHeight() + } + + WappCard( + modifier = cardModifier, ) { Column( modifier = Modifier From 7fb95a74237cfe48d6bd02d69a139d353b0e4600 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:27:38 +0900 Subject: [PATCH 002/102] =?UTF-8?q?[FEATURE]=20#106=20:=20GetDateEventList?= =?UTF-8?q?UseCase=EC=97=90=EC=84=9C=20GetMonthEventList=EB=A5=BC=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=ED=95=98=EB=8D=98=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/usecase/event/GetDateEventListUseCase.kt | 2 +- .../wap/wapp/feature/management/ManagementViewModel.kt | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/GetDateEventListUseCase.kt b/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/GetDateEventListUseCase.kt index f3406db4..a3768420 100644 --- a/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/GetDateEventListUseCase.kt +++ b/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/GetDateEventListUseCase.kt @@ -9,5 +9,5 @@ class GetDateEventListUseCase @Inject constructor( private val eventRepository: EventRepository, ) { suspend operator fun invoke(date: LocalDate): Result> = - eventRepository.getMonthEventList(date) + eventRepository.getDateEventList(date) } diff --git a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementViewModel.kt b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementViewModel.kt index ba2399d2..53235343 100644 --- a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementViewModel.kt +++ b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementViewModel.kt @@ -42,12 +42,8 @@ class ManagementViewModel @Inject constructor( fun getUserRole() { viewModelScope.launch { getUserRoleUseCase() - .onSuccess { userRole -> - _userRole.emit(userRole) - } - .onFailure { exception -> - _errorFlow.emit(exception) - } + .onSuccess { userRole -> _userRole.emit(userRole) } + .onFailure { exception -> _errorFlow.emit(exception) } } } From 9531931757190785739c3369126f76f4d28c76b1 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:37:32 +0900 Subject: [PATCH 003/102] =?UTF-8?q?[FEATURE]=20#106=20:=20=EC=98=A4?= =?UTF-8?q?=EB=8A=98=20=EC=9D=BC=EC=A0=95=EC=9D=B4=20=EC=9E=88=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0,=20=EC=B6=9C=EC=84=9D=20=EC=B9=B4=EB=93=9C?= =?UTF-8?q?=EC=97=90=20=ED=99=94=EC=82=B4=ED=91=9C=20=EC=83=9D=EA=B8=B0?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profilesetting/component/UserProfile.kt | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt index bbbdefb5..7e88c01b 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize @@ -93,44 +94,51 @@ private fun ProfileAttendanceCard( WappCard( modifier = cardModifier, ) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 15.dp, vertical = 10.dp), - ) { - Row(verticalAlignment = Alignment.CenterVertically) { + Box(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(horizontal = 15.dp, vertical = 10.dp)) { + Row(verticalAlignment = Alignment.CenterVertically) { + Text( + text = stringResource(id = R.string.wap_attendance), + style = WappTheme.typography.captionBold.copy(fontSize = 20.sp), + color = WappTheme.colors.white, + ) + + Image( + painter = painterResource(id = drawable.ic_check), + contentDescription = "", + modifier = Modifier.padding(start = 10.dp), + ) + } Text( - text = stringResource(id = R.string.wap_attendance), - style = WappTheme.typography.captionBold.copy(fontSize = 20.sp), + text = DateUtil.generateNowDate().format(DateUtil.yyyyMMddFormatter), + style = WappTheme.typography.contentRegular, color = WappTheme.colors.white, + modifier = Modifier.padding(top = 20.dp), ) - Image( - painter = painterResource(id = drawable.ic_check), - contentDescription = "", - modifier = Modifier.padding(start = 10.dp), - ) + if (todayEventsState.events.isEmpty()) { + Text( + text = stringResource(id = R.string.no_event_today), + style = WappTheme.typography.contentRegular.copy(fontSize = 20.sp), + color = WappTheme.colors.white, + modifier = Modifier.padding(top = 5.dp), + ) + } else { + Text( + text = generateTodayEventString(events = todayEventsState.events), + style = WappTheme.typography.contentRegular.copy(fontSize = 20.sp), + color = WappTheme.colors.white, + modifier = Modifier.padding(top = 5.dp), + ) + } } - Text( - text = DateUtil.generateNowDate().format(DateUtil.yyyyMMddFormatter), - style = WappTheme.typography.contentRegular, - color = WappTheme.colors.white, - modifier = Modifier.padding(top = 20.dp), - ) - - if (todayEventsState.events.isEmpty()) { - Text( - text = stringResource(id = R.string.no_event_today), - style = WappTheme.typography.contentRegular.copy(fontSize = 20.sp), - color = WappTheme.colors.white, - modifier = Modifier.padding(top = 5.dp), - ) - } else { - Text( - text = generateTodayEventString(events = todayEventsState.events), - style = WappTheme.typography.contentRegular.copy(fontSize = 20.sp), - color = WappTheme.colors.white, - modifier = Modifier.padding(top = 5.dp), + if (todayEventsState.events.isNotEmpty()) { + Image( + painter = painterResource(id = drawable.ic_forward), + contentDescription = null, + modifier = Modifier + .align(Alignment.CenterEnd) + .padding(end = 12.dp), ) } } From 16b2982d91be5e2f5228745591290b065ea980c5 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:39:52 +0900 Subject: [PATCH 004/102] =?UTF-8?q?[FEATURE]=20#106=20:=20WappProfileCard?= =?UTF-8?q?=20=EA=B3=A0=EC=96=91=EC=9D=B4=20=EC=9C=84=EC=B9=98=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/wapp/feature/profile/component/WappProfileCard.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt index 8c191898..0b6f7eba 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt @@ -73,8 +73,8 @@ internal fun WappProfileCard( painter = painterResource(id = catImage), contentDescription = null, modifier = Modifier - .align(Alignment.CenterEnd) - .padding(end = 10.dp, top = 25.dp), + .align(Alignment.BottomEnd) + .padding(end = 10.dp, bottom = 5.dp), ) } } From 831581ae44a59c5ed4c214d8ac46ece3f6508268 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:40:18 +0900 Subject: [PATCH 005/102] =?UTF-8?q?[FEATURE]=20#106=20:=20WappProfileCard?= =?UTF-8?q?=20=EB=86=92=EC=9D=B4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/wapp/feature/profile/component/WappProfileCard.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt index 0b6f7eba..b8b54b70 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt @@ -33,7 +33,7 @@ internal fun WappProfileCard( shape = RoundedCornerShape(16.dp), modifier = Modifier .fillMaxWidth() - .height(150.dp) + .height(130.dp) .padding(horizontal = 10.dp), ) { Box( From ef3990f5f456e364a0e07148a75e8c13aa77c7df Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:46:05 +0900 Subject: [PATCH 006/102] =?UTF-8?q?[FEATURE]=20#106=20:=20Profile=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=B6=9C=EA=B2=B0=ED=98=84=ED=99=A9,=20?= =?UTF-8?q?=EC=84=A4=EB=AC=B8,=20=EC=B6=9C=EC=84=9D=EC=B9=B4=EB=93=9C=20?= =?UTF-8?q?=EB=86=92=EC=9D=B4=20Figma=EC=97=90=20=EB=AA=85=EC=8B=9C?= =?UTF-8?q?=EB=90=9C=20=EA=B1=B8=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/core/commmon/util/DateUtil.kt | 3 +++ .../wapp/feature/profile/component/WappAttendanceRow.kt | 2 +- .../wapp/feature/profile/component/WappProfileCard.kt | 6 +----- .../profile/profilesetting/component/UserProfile.kt | 9 ++++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/common/src/main/java/com/wap/wapp/core/commmon/util/DateUtil.kt b/core/common/src/main/java/com/wap/wapp/core/commmon/util/DateUtil.kt index 896aa9b5..0860bf95 100644 --- a/core/common/src/main/java/com/wap/wapp/core/commmon/util/DateUtil.kt +++ b/core/common/src/main/java/com/wap/wapp/core/commmon/util/DateUtil.kt @@ -29,6 +29,9 @@ object DateUtil { // 현재 날짜를 년-월-일 형식으로 반환해주는 포맷. ex 2023-11-20 val yyyyMMddFormatter = DateTimeFormatter.ofPattern("yyyy.MM.dd") + // 현재 날짜를 월-일 형식으로 반환해주는 포맷. ex 11월 20일 + val MMddFormatter = DateTimeFormatter.ofPattern("MM월 dd일") + enum class DaysOfWeek(val displayName: String) { SUNDAY("일"), MONDAY("월"), diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappAttendanceRow.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappAttendanceRow.kt index 60d1fc99..f1b59399 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappAttendanceRow.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappAttendanceRow.kt @@ -42,7 +42,7 @@ internal fun WappAttendacneRow( ) } Text( - text = event.startDateTime.format(DateUtil.HHmmFormatter), + text = event.startDateTime.format(DateUtil.MMddFormatter), style = WappTheme.typography.labelRegular, color = WappTheme.colors.gray95, modifier = Modifier.padding(start = 10.dp), diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt index b8b54b70..b4b576bf 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt @@ -36,11 +36,7 @@ internal fun WappProfileCard( .height(130.dp) .padding(horizontal = 10.dp), ) { - Box( - modifier = Modifier.background( - brush = brush, - ), - ) { + Box(modifier = Modifier.background(brush = brush)) { Row( verticalAlignment = Alignment.CenterVertically, modifier = Modifier.align(Alignment.CenterStart), diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt index 7e88c01b..08c05d79 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.RoundedCornerShape @@ -83,12 +82,12 @@ private fun ProfileAttendanceCard( shape = RoundedCornerShape(10.dp), ) .fillMaxWidth() - .wrapContentHeight() + .height(130.dp) .clickable { } } else { modifier .fillMaxWidth() - .wrapContentHeight() + .height(130.dp) } WappCard( @@ -163,7 +162,7 @@ private fun MyAttendanceStatus( WappCard( modifier = Modifier .fillMaxWidth() - .wrapContentHeight() + .height(130.dp) .padding(top = 10.dp), ) { when (recentEventsState) { @@ -214,7 +213,7 @@ private fun MySurveyHistory( WappCard( modifier = Modifier .fillMaxWidth() - .wrapContentHeight() + .height(130.dp) .padding(top = 10.dp), ) { when (userRespondedSurveysState) { From 36238c49c4de1c648df0a9748f6ea75d072f5a60 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:55:50 +0900 Subject: [PATCH 007/102] =?UTF-8?q?[FEATURE]=20#106=20:=20WappRightBUtton?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wap/designsystem/component/MainTopBar.kt | 89 +++++++++++++++++-- .../feature/management/ManagementScreen.kt | 4 +- .../wap/wapp/feature/profile/ProfileScreen.kt | 4 +- .../feature/survey/check/SurveyCheckScreen.kt | 4 +- .../wap/wapp/feature/survey/SurveyScreen.kt | 4 +- 5 files changed, 90 insertions(+), 15 deletions(-) diff --git a/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt b/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt index 31cac16e..70227ab1 100644 --- a/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt +++ b/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt @@ -23,7 +23,7 @@ import com.wap.designsystem.WappTheme import com.wap.wapp.core.designsystem.R @Composable -fun WappMainTopBar( +fun WappLeftMainTopBar( @StringRes titleRes: Int, @StringRes contentRes: Int, showSettingButton: Boolean = false, @@ -66,14 +66,58 @@ fun WappMainTopBar( } } -@Preview("without Button TopBar") @Composable -fun WappMainTopBarWithoutButton() { +fun WappRightMainTopBar( + @StringRes titleRes: Int, + @StringRes contentRes: Int, + showLeftButton: Boolean = false, + onClickLeftButton: () -> Unit = {}, + @StringRes settingButtonDescriptionRes: Int = R.string.setting_button, + modifier: Modifier = Modifier, +) { + Column( + verticalArrangement = Arrangement.spacedBy(16.dp), + horizontalAlignment = Alignment.End, + modifier = modifier + .padding(top = 40.dp, start = 24.dp, end = 24.dp, bottom = 20.dp) + .fillMaxWidth() + .wrapContentHeight(), + ) { + Box(modifier = Modifier.fillMaxWidth()) { + Text( + text = stringResource(id = titleRes), + color = WappTheme.colors.white, + style = WappTheme.typography.titleBold.copy(fontSize = 24.sp), + modifier = Modifier.align(Alignment.CenterEnd), + ) + + if (showLeftButton) { + Image( + painter = + painterResource(id = R.drawable.ic_back), + contentDescription = stringResource(id = settingButtonDescriptionRes), + modifier = Modifier + .align(Alignment.CenterStart) + .clickable { onClickLeftButton() }, + ) + } + } + Text( + text = stringResource(id = contentRes), + color = WappTheme.colors.white, + style = WappTheme.typography.contentRegular, + ) + } +} + +@Preview("without Button Left TopBar") +@Composable +fun WappLeftMainTopBarWithoutButton() { WappTheme { Surface( color = WappTheme.colors.backgroundBlack, ) { - WappMainTopBar( + WappLeftMainTopBar( titleRes = R.string.notice, contentRes = R.string.notice, ) @@ -81,14 +125,14 @@ fun WappMainTopBarWithoutButton() { } } -@Preview("with Button TopBar") +@Preview("with Button Left TopBar") @Composable -fun WappMainTopBarWithButton() { +fun WappLeftMainTopBarWithButton() { WappTheme { Surface( color = WappTheme.colors.backgroundBlack, ) { - WappMainTopBar( + WappLeftMainTopBar( titleRes = R.string.notice, contentRes = R.string.notice, showSettingButton = true, @@ -96,3 +140,34 @@ fun WappMainTopBarWithButton() { } } } + +@Preview("without Button Right TopBar") +@Composable +fun WappRightMainTopBarWithoutButton() { + WappTheme { + Surface( + color = WappTheme.colors.backgroundBlack, + ) { + WappRightMainTopBar( + titleRes = R.string.notice, + contentRes = R.string.notice, + ) + } + } +} + +@Preview("with Button Right TopBar") +@Composable +fun WappRightMainTopBarWithButton() { + WappTheme { + Surface( + color = WappTheme.colors.backgroundBlack, + ) { + WappRightMainTopBar( + titleRes = R.string.notice, + contentRes = R.string.notice, + showLeftButton = true, + ) + } + } +} diff --git a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt index b2c43725..39c73255 100644 --- a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt +++ b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.graphics.Color import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme -import com.wap.designsystem.component.WappMainTopBar +import com.wap.designsystem.component.WappLeftMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText import com.wap.wapp.core.model.user.UserRole import com.wap.wapp.feature.management.validation.ManagementValidationScreen @@ -97,7 +97,7 @@ internal fun ManagementScreen( containerColor = WappTheme.colors.backgroundBlack, snackbarHost = { SnackbarHost(snackBarHostState) }, topBar = { - WappMainTopBar( + WappLeftMainTopBar( titleRes = R.string.management, contentRes = R.string.management_content, ) diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt index b9d9c0e4..e6b2a184 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt @@ -23,7 +23,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.CircleLoader -import com.wap.designsystem.component.WappMainTopBar +import com.wap.designsystem.component.WappLeftMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.core.designresource.R.string @@ -104,7 +104,7 @@ internal fun ProfileScreen( } is UserRoleState.Success -> { - WappMainTopBar( + WappLeftMainTopBar( titleRes = string.profile, contentRes = R.string.profile_content, settingButtonDescriptionRes = R.string.profile_setting_description, diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt index c38c022f..a2a313c7 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt @@ -18,7 +18,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.CircleLoader -import com.wap.designsystem.component.WappMainTopBar +import com.wap.designsystem.component.WappLeftMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText import kotlinx.coroutines.flow.collectLatest @@ -41,7 +41,7 @@ internal fun SurveyCheckScreen( containerColor = WappTheme.colors.backgroundBlack, snackbarHost = { SnackbarHost(snackBarHostState) }, topBar = { - WappMainTopBar( + WappLeftMainTopBar( titleRes = R.string.survey_check, contentRes = R.string.survey_check_content, ) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt index 1c39e458..df83096e 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme -import com.wap.designsystem.component.WappMainTopBar +import com.wap.designsystem.component.WappLeftMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText import com.wap.wapp.core.model.user.UserRole import kotlinx.coroutines.flow.collectLatest @@ -88,7 +88,7 @@ internal fun SurveyScreen( containerColor = WappTheme.colors.backgroundBlack, snackbarHost = { SnackbarHost(snackBarHostState) }, topBar = { - WappMainTopBar( + WappLeftMainTopBar( titleRes = R.string.survey, contentRes = R.string.survey_content, ) From 1c7bc11fdb6a0c1fe52d6d7ba6aa16d74d683df5 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 08:56:57 +0900 Subject: [PATCH 008/102] =?UTF-8?q?[FEATURE]=20#106=20:=20WappRightButton?= =?UTF-8?q?=20BackButton=20ContentDescription=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/designsystem/component/MainTopBar.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt b/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt index 70227ab1..5dfff653 100644 --- a/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt +++ b/core/designsystem/src/main/java/com/wap/designsystem/component/MainTopBar.kt @@ -70,9 +70,9 @@ fun WappLeftMainTopBar( fun WappRightMainTopBar( @StringRes titleRes: Int, @StringRes contentRes: Int, - showLeftButton: Boolean = false, - onClickLeftButton: () -> Unit = {}, - @StringRes settingButtonDescriptionRes: Int = R.string.setting_button, + showBackButton: Boolean = false, + onClickBackButton: () -> Unit = {}, + @StringRes settingButtonDescriptionRes: Int = R.string.back_button, modifier: Modifier = Modifier, ) { Column( @@ -91,14 +91,14 @@ fun WappRightMainTopBar( modifier = Modifier.align(Alignment.CenterEnd), ) - if (showLeftButton) { + if (showBackButton) { Image( painter = painterResource(id = R.drawable.ic_back), contentDescription = stringResource(id = settingButtonDescriptionRes), modifier = Modifier .align(Alignment.CenterStart) - .clickable { onClickLeftButton() }, + .clickable { onClickBackButton() }, ) } } @@ -166,7 +166,7 @@ fun WappRightMainTopBarWithButton() { WappRightMainTopBar( titleRes = R.string.notice, contentRes = R.string.notice, - showLeftButton = true, + showBackButton = true, ) } } From 72bf47f4e9058be8b45cb1c56a3345a96fab9782 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Fri, 19 Jan 2024 09:02:31 +0900 Subject: [PATCH 009/102] =?UTF-8?q?[ADD]=20#106=20:=20Attendance=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 3 +- app/build.gradle.kts | 1 + feature/attendance/.gitignore | 1 + feature/attendance/build.gradle.kts | 38 +++++++++++++++++++ feature/attendance/consumer-rules.pro | 0 feature/attendance/proguard-rules.pro | 21 ++++++++++ .../attendance/ExampleInstrumentedTest.kt | 23 +++++++++++ .../attendance/src/main/AndroidManifest.xml | 4 ++ .../feature/attendance/ExampleUnitTest.kt | 16 ++++++++ settings.gradle.kts | 2 +- 10 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 feature/attendance/.gitignore create mode 100644 feature/attendance/build.gradle.kts create mode 100644 feature/attendance/consumer-rules.pro create mode 100644 feature/attendance/proguard-rules.pro create mode 100644 feature/attendance/src/androidTest/java/com/wap/wapp/feature/attendance/ExampleInstrumentedTest.kt create mode 100644 feature/attendance/src/main/AndroidManifest.xml create mode 100644 feature/attendance/src/test/java/com/wap/wapp/feature/attendance/ExampleUnitTest.kt diff --git a/.idea/gradle.xml b/.idea/gradle.xml index edd5bcf2..3df48149 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,7 +16,6 @@ -