From bedebba4e88eeb4af03f247139aaddfdcd5049bb Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Mon, 12 Feb 2024 22:45:11 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[FEATURE]=20#116=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=EC=B2=B4=ED=81=AC=20=ED=99=94=EB=A9=B4=20=EB=B0=8F=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=ED=99=95=EC=9D=B8=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?BottomNavigation=20=EC=95=88=EB=B3=B4=EC=9D=B4=EA=B2=8C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 15 ++++++++++++++- app/src/main/java/com/wap/wapp/MainActivity.kt | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 0c0c33838..6467ac86e 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -3,7 +3,20 @@ - + + + + + + + + + + + + + + diff --git a/app/src/main/java/com/wap/wapp/MainActivity.kt b/app/src/main/java/com/wap/wapp/MainActivity.kt index e7eec1af4..27314a0de 100644 --- a/app/src/main/java/com/wap/wapp/MainActivity.kt +++ b/app/src/main/java/com/wap/wapp/MainActivity.kt @@ -32,6 +32,8 @@ import com.wap.wapp.feature.management.event.navigation.eventRegistrationNavigat import com.wap.wapp.feature.management.survey.navigation.ManagementSurveyRoute import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavigationRoute import com.wap.wapp.feature.splash.navigation.splashNavigationRoute +import com.wap.wapp.feature.survey.check.navigation.SurveyCheckRoute +import com.wap.wapp.feature.survey.check.navigation.SurveyCheckRoute.surveyCheckRoute import com.wap.wapp.feature.survey.navigation.SurveyRoute import com.wap.wapp.navigation.TopLevelDestination import com.wap.wapp.navigation.WappNavHost @@ -114,6 +116,8 @@ private fun handleBottomBarState( ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false) eventRegistrationNavigationRoute -> setBottomBarState(false) SurveyRoute.answerRoute("{id}") -> setBottomBarState(false) + surveyCheckRoute -> setBottomBarState(false) + SurveyCheckRoute.surveyDetailRoute("{id}") -> setBottomBarState(false) else -> setBottomBarState(true) } From 0dcfe208191107bfd262286fb4357aabaee21cbe Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Mon, 12 Feb 2024 22:54:32 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[FIX]=20#116=20:=20gesture=20NavigationBar?= =?UTF-8?q?=EC=9D=B8=20=ED=99=94=EB=A9=B4=EC=97=90=EC=84=9C=20=EB=B6=88?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EB=A7=88=EC=A7=84=20=EC=97=86?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/MainActivity.kt | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/wap/wapp/MainActivity.kt b/app/src/main/java/com/wap/wapp/MainActivity.kt index 27314a0de..74d5e9b54 100644 --- a/app/src/main/java/com/wap/wapp/MainActivity.kt +++ b/app/src/main/java/com/wap/wapp/MainActivity.kt @@ -1,22 +1,22 @@ package com.wap.wapp -import android.content.res.Resources import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.SystemBarStyle import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.Scaffold import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.unit.Density import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination @@ -52,8 +52,6 @@ class MainActivity : ComponentActivity() { setContent { WappTheme { val navController = rememberNavController() - val density = LocalDensity.current - val navigationBarHeight = getNavigationBarHeight(density) Scaffold( containerColor = WappTheme.colors.backgroundBlack, @@ -84,7 +82,7 @@ class MainActivity : ComponentActivity() { ) }, modifier = Modifier - .padding(bottom = navigationBarHeight) + .windowInsetsPadding(WindowInsets.navigationBars) .fillMaxSize(), ) { innerPadding -> WappNavHost( @@ -133,15 +131,3 @@ private fun navigateToTopLevelDestination( restoreState = true } } - -private fun getNavigationBarHeight(density: Density) = with(density) { - Resources.getSystem().run { - getDimensionPixelSize( - getIdentifier( - "navigation_bar_height", - "dimen", - "android", - ), - ).toDp() - } -} From 0009f2f1586cbbd32cf6bec6dab5eac6bcc318a9 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Mon, 12 Feb 2024 23:10:04 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[FEATURE]=20#116=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=ED=99=95=EC=9D=B8=20detail=20=ED=99=94=EB=A9=B4=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=84=A4=EB=AC=B8=20=ED=99=95=EC=9D=B8=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=9C=BC=EB=A1=9C=20=EB=8F=8C=EC=95=84=EA=B0=94?= =?UTF-8?q?=EC=9D=84=20=EB=95=8C,=20Back=EC=9D=84=20=EB=88=84=EB=A5=BC=20?= =?UTF-8?q?=EC=8B=9C=20=EC=84=A4=EB=AC=B8=EC=9C=BC=EB=A1=9C=20=EA=B0=80?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 15 +-------------- .../java/com/wap/wapp/navigation/WappNavHost.kt | 11 +++++++---- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 6467ac86e..0c0c33838 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -3,20 +3,7 @@ - - - - - - - - - - - - - - + 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 19df14389..0c8c407c4 100644 --- a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt +++ b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt @@ -36,6 +36,7 @@ import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavi import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingScreen import com.wap.wapp.feature.splash.navigation.splashNavigationRoute import com.wap.wapp.feature.splash.navigation.splashScreen +import com.wap.wapp.feature.survey.check.navigation.SurveyCheckRoute.surveyCheckRoute import com.wap.wapp.feature.survey.check.navigation.navigateToSurveyCheck import com.wap.wapp.feature.survey.check.navigation.navigateToSurveyDetail import com.wap.wapp.feature.survey.check.navigation.surveyCheckNavGraph @@ -65,9 +66,7 @@ fun WappNavHost( }, navigateToNotice = { navController.navigateToNotice( - navOptions { - popUpTo(splashNavigationRoute) { inclusive = true } - }, + navOptions { popUpTo(splashNavigationRoute) { inclusive = true } }, ) }, ) @@ -88,7 +87,11 @@ fun WappNavHost( navigateToSurveyCheck = navController::navigateToSurveyCheck, ) surveyCheckNavGraph( - navigateToSurveyCheck = navController::navigateToSurveyCheck, + navigateToSurveyCheck = { + navController.navigateToSurveyCheck( + navOptions { popUpTo(surveyCheckRoute) { inclusive = true } }, + ) + }, navigateToSurveyDetail = navController::navigateToSurveyDetail, ) managementSurveyNavGraph( From abc677943e6c28ae023d22fa41f56102585c79bf Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Tue, 13 Feb 2024 01:09:04 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[FIX]=20#116=20:=20=EB=8B=B9=EC=9D=BC=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=EC=9D=80=20=EC=9E=88=EC=A7=80=EB=A7=8C,=20?= =?UTF-8?q?=EC=95=84=EC=A7=81=20=EC=9A=B4=EC=98=81=EC=A7=84=EC=97=90=20?= =?UTF-8?q?=EC=9D=98=ED=95=B4=EC=84=9C=20=EC=B6=9C=EC=84=9D=EC=9D=B4=20?= =?UTF-8?q?=EC=97=B4=EB=A6=AC=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=EC=97=90=20=EB=8C=80=ED=95=B4=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=A1=B0=EC=82=AC=ED=95=98=EB=A0=A4=EA=B3=A0=20?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20null=EA=B0=92=EC=9D=84=20=EB=B1=89?= =?UTF-8?q?=EB=8A=94=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../network/source/attendance/AttendanceDataSourceImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt index cd48913c3..c9b0b4309 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt @@ -35,6 +35,8 @@ class AttendanceDataSourceImpl @Inject constructor( .await() val attendanceResponse = task.toObject() - checkNotNull(attendanceResponse) + attendanceResponse ?: AttendanceResponse(eventId = eventId, "", defaultDeadLine) } } + +private val defaultDeadLine = "2000-01-01T00:00:00.000000" From 5a25d094689fbe13bed82a3c9d0500f300038358 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Tue, 13 Feb 2024 01:48:14 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[FIX]=20#116=20:=20=EC=B6=9C=EC=84=9D=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=EC=9D=84=20=EA=B0=80=EC=A0=B8=EC=98=AC=20?= =?UTF-8?q?=EB=95=8C,=20isBeforeEnd=EC=97=90=EC=84=9C=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=EB=A7=81=20=EB=90=98=EC=97=88=EC=A7=80=EB=A7=8C=20eventId?= =?UTF-8?q?=EB=8A=94=20=ED=95=84=ED=84=B0=EB=A7=81=20=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=95=84=EC=84=9C=20=ED=95=84=ED=84=B0=EB=A7=81=20?= =?UTF-8?q?=EB=90=9C=20eventId=EA=B0=80=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/attendance/AttendanceScreen.kt | 4 +--- .../feature/attendance/AttendanceViewModel.kt | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceScreen.kt b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceScreen.kt index c63e1fce0..af5567c86 100644 --- a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceScreen.kt +++ b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceScreen.kt @@ -76,9 +76,7 @@ internal fun AttendanceRoute( getTodayEventsAttendanceStatus() } - is Failure -> snackBarHostState.showSnackbar( - getString(context, R.string.attendance_failure), - ) + is Failure -> snackBarHostState.showSnackbar(event.message) } } } diff --git a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt index 04d56f8ba..2a8045771 100644 --- a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt +++ b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt @@ -95,7 +95,11 @@ class AttendanceViewModel @Inject constructor( private suspend fun getEventListAttendance(eventList: List, userId: String) = getEventListAttendanceUseCase(eventList.map { it.eventId }) .onSuccess { attendanceList -> - val eventAttendanceList = eventList.zip(attendanceList) + val filteredEventList = eventList.filter { + it.eventId in attendanceList.map { it.eventId } + } + + val eventAttendanceList = filteredEventList.zip(attendanceList) .map { (event, attendance) -> EventAttendanceStatus( eventId = event.eventId, @@ -104,6 +108,7 @@ class AttendanceViewModel @Inject constructor( remainAttendanceDateTime = attendance.calculateDeadline(), ) } + getEventListAttendanceStatus( eventAttendanceList = eventAttendanceList, userId = userId, @@ -129,6 +134,7 @@ class AttendanceViewModel @Inject constructor( isAttendance = attendanceStatus.isAttendance(), ) } + _todayEventsAttendanceStatus.value = EventAttendanceStatusState.Success(eventAttendanceStatusList) }.onFailure { _errorFlow.emit(it) } @@ -159,11 +165,17 @@ class AttendanceViewModel @Inject constructor( } } - fun clearAttendanceCode() { _attendanceCode.value = "" } + fun clearAttendanceCode() { + _attendanceCode.value = "" + } - fun setSelectedEventId(eventId: String) { _selectedEventId.value = eventId } + fun setSelectedEventId(eventId: String) { + _selectedEventId.value = eventId + } - fun setSelectedEventTitle(eventTitle: String) { _selectedEventTitle.value = eventTitle } + fun setSelectedEventTitle(eventTitle: String) { + _selectedEventTitle.value = eventTitle + } sealed class EventAttendanceStatusState { data object Loading : EventAttendanceStatusState() From 3d7414455789c0eb8480277bc88e3afa0110eab2 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Tue, 13 Feb 2024 01:58:19 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[CHORE]=20#116=20:=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wapp/feature/attendance/AttendanceViewModel.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt index 2a8045771..02e62ecba 100644 --- a/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt +++ b/feature/attendance/src/main/java/com/wap/wapp/feature/attendance/AttendanceViewModel.kt @@ -165,17 +165,11 @@ class AttendanceViewModel @Inject constructor( } } - fun clearAttendanceCode() { - _attendanceCode.value = "" - } + fun clearAttendanceCode() { _attendanceCode.value = "" } - fun setSelectedEventId(eventId: String) { - _selectedEventId.value = eventId - } + fun setSelectedEventId(eventId: String) { _selectedEventId.value = eventId } - fun setSelectedEventTitle(eventTitle: String) { - _selectedEventTitle.value = eventTitle - } + fun setSelectedEventTitle(eventTitle: String) { _selectedEventTitle.value = eventTitle } sealed class EventAttendanceStatusState { data object Loading : EventAttendanceStatusState() From ee12c3a3dd9914f6c81c4a90113c75ec0b62b382 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Wed, 14 Feb 2024 00:59:16 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[CHORE]=20#116=20:=20DefaultLocalDateTime?= =?UTF-8?q?=20->=20LocalDateTime.MIN=20=EC=9C=BC=EB=A1=9C=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 --- .../source/attendance/AttendanceDataSourceImpl.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt index c9b0b4309..a36c8b28f 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/attendance/AttendanceDataSourceImpl.kt @@ -6,6 +6,8 @@ import com.wap.wapp.core.network.constant.ATTENDANCE_COLLECTION import com.wap.wapp.core.network.model.attendance.AttendanceRequest import com.wap.wapp.core.network.model.attendance.AttendanceResponse import com.wap.wapp.core.network.utils.await +import com.wap.wapp.core.network.utils.toISOLocalDateTimeString +import java.time.LocalDateTime import javax.inject.Inject class AttendanceDataSourceImpl @Inject constructor( @@ -35,8 +37,10 @@ class AttendanceDataSourceImpl @Inject constructor( .await() val attendanceResponse = task.toObject() - attendanceResponse ?: AttendanceResponse(eventId = eventId, "", defaultDeadLine) + attendanceResponse ?: AttendanceResponse( + eventId = eventId, + "", + LocalDateTime.MIN.toISOLocalDateTimeString(), + ) } } - -private val defaultDeadLine = "2000-01-01T00:00:00.000000"