diff --git a/app/release/app-release.apk b/app/release/app-release.apk new file mode 100644 index 0000000..a4e70ed Binary files /dev/null and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..6895d5d --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.example.remind", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-release.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/app/src/main/java/com/example/remind/app/RemindNavHost.kt b/app/src/main/java/com/example/remind/app/RemindNavHost.kt index 1bf5f21..c103869 100644 --- a/app/src/main/java/com/example/remind/app/RemindNavHost.kt +++ b/app/src/main/java/com/example/remind/app/RemindNavHost.kt @@ -17,7 +17,7 @@ import com.example.remind.feature.screens.doctor.DoctorViewModel fun RemindNavHost() { val navHostController = rememberNavController() val onBoardingViewModel: OnBoardingViewModel = hiltViewModel() - val doctorViewModel: DoctorViewModel = hiltViewModel() + //val doctorViewModel: DoctorViewModel = hiltViewModel() NavHost( navController = navHostController, startDestination = Screens.Splash.route @@ -27,7 +27,7 @@ fun RemindNavHost() { composable(route = Screens.Patience.route) { PatienceScreen() } - DoctorGraph(navHostController,doctorViewModel) + DoctorGraph(navHostController) CenterGraph(navHostController) } } diff --git a/app/src/main/java/com/example/remind/core/common/component/MainAppBar.kt b/app/src/main/java/com/example/remind/core/common/component/MainAppBar.kt index 694f9f0..51ade72 100644 --- a/app/src/main/java/com/example/remind/core/common/component/MainAppBar.kt +++ b/app/src/main/java/com/example/remind/core/common/component/MainAppBar.kt @@ -1,6 +1,7 @@ package com.example.remind.core.common.component import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -41,7 +42,8 @@ fun MainAppBar( painter = painterResource(id = R.drawable.ic_setting), contentDescription = null, modifier = modifier - .size(width = 24.dp, height = 28.dp), + .size(width = 24.dp, height = 28.dp) + .clickable(onClick = onClick), tint = RemindTheme.colors.icon ) } diff --git a/app/src/main/java/com/example/remind/data/model/request/OnBoardingRequest.kt b/app/src/main/java/com/example/remind/data/model/request/OnBoardingRequest.kt index dc78344..4c0913d 100644 --- a/app/src/main/java/com/example/remind/data/model/request/OnBoardingRequest.kt +++ b/app/src/main/java/com/example/remind/data/model/request/OnBoardingRequest.kt @@ -13,6 +13,7 @@ data class OnBoardingRequest( val doctorLicenseNumber: String = "", val birthday: String = "", val phoneNumber: String = "", + val hospitalName: String = "", val gender: String = "", val name: String = "", ) \ No newline at end of file diff --git a/app/src/main/java/com/example/remind/data/model/response/GetPatientResponse.kt b/app/src/main/java/com/example/remind/data/model/response/GetPatientResponse.kt index 0f96e20..32396ce 100644 --- a/app/src/main/java/com/example/remind/data/model/response/GetPatientResponse.kt +++ b/app/src/main/java/com/example/remind/data/model/response/GetPatientResponse.kt @@ -14,6 +14,7 @@ data class PatientDto( val age: Int=0, val gender: String="", val memberId: Int=0, - val name: String="" + val name: String="", + val birthYear: Int = 0 ) diff --git a/app/src/main/java/com/example/remind/data/model/response/GetPrescriptionResponse.kt b/app/src/main/java/com/example/remind/data/model/response/GetPrescriptionResponse.kt index 927da66..d65c298 100644 --- a/app/src/main/java/com/example/remind/data/model/response/GetPrescriptionResponse.kt +++ b/app/src/main/java/com/example/remind/data/model/response/GetPrescriptionResponse.kt @@ -20,4 +20,4 @@ data class Prescription( val period: Int = 0, val prescriptionDate: String = "", val prescriptionId: Int = 0 -) \ No newline at end of file +) diff --git a/app/src/main/java/com/example/remind/data/network/service/AuthService.kt b/app/src/main/java/com/example/remind/data/network/service/AuthService.kt index 2bce768..a89a637 100644 --- a/app/src/main/java/com/example/remind/data/network/service/AuthService.kt +++ b/app/src/main/java/com/example/remind/data/network/service/AuthService.kt @@ -24,7 +24,7 @@ interface AuthService { @Body body: KakaoLoginRequest ): ApiResult - @POST("/prescription/relation/accept") + @POST("/member/onboarding") suspend fun OnBoarding( @Body body: OnBoardingRequest ): ApiResult diff --git a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingContract.kt b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingContract.kt index a0cc038..2542746 100644 --- a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingContract.kt +++ b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingContract.kt @@ -25,7 +25,7 @@ class OnBoardingContract { data class NextButtonFinalPatience(val number: String): Event() data class NextButtonFinalDoctor(val certifinumber: String): Event() data class NavigateButtonClicked(val destinationRoute: String, val currentRoute: String, val inclusive: Boolean): Event() - data class StoreUserInfoButtonClicked(val info: OnBoardingRequest): Event() + data class StoreUserInfoButtonClicked(val name: String, val gender: String, val phoneNumber: String, val birthday: String, val hospitalName: String ): Event() object ErrorMsg: Event() } diff --git a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt index fce0ca7..91a07d4 100644 --- a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt +++ b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt @@ -173,7 +173,7 @@ fun CheckReading( Spacer(modifier = Modifier.height(10.dp)) Text( text = stringResource(id = R.string.긴급_상황_발생시_담당자가_보호자에게), - style = RemindTheme.typography.c1Regular.copy(color = RemindTheme.colors.grayscale_3, lineHeight = 6.sp) + style = RemindTheme.typography.c1Regular.copy(color = RemindTheme.colors.grayscale_3, lineHeight = 22.sp) ) } } @@ -182,19 +182,8 @@ fun CheckReading( @Preview(showBackground = true) @Composable fun OnBoardingPreview() { - Column( - modifier = Modifier.fillMaxSize() - ) { - Column() { - Text( - text = stringResource(id = R.string.긴급_상황_발생_시_보호자에게_연락), - style = RemindTheme.typography.b3Medium.copy(color = RemindTheme.colors.black) - ) - Spacer(modifier = Modifier.height(4.dp)) - Text( - text = stringResource(id = R.string.긴급_상황_발생시_담당자가_보호자에게), - style = RemindTheme.typography.c1Regular.copy(color = RemindTheme.colors.grayscale_3, lineHeight = 6.sp) - ) - } - } + Text( + text = stringResource(id = R.string.긴급_상황_발생시_담당자가_보호자에게), + style = RemindTheme.typography.c1Regular.copy(color = RemindTheme.colors.grayscale_3, lineHeight = 22.sp) + ) } \ No newline at end of file diff --git a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingUserInfoScreen.kt b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingUserInfoScreen.kt index 58289cd..19cc01b 100644 --- a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingUserInfoScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingUserInfoScreen.kt @@ -2,6 +2,7 @@ package com.example.remind.feature.screens.auth.onboarding import android.widget.Toast import androidx.compose.foundation.background +import androidx.compose.foundation.gestures.scrollable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -9,7 +10,9 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Checkbox import androidx.compose.material3.CheckboxDefaults import androidx.compose.material3.Text @@ -50,6 +53,7 @@ fun OnBoardingUserInfoScreen( var isCheckedMale by remember{ mutableStateOf(false) } var isCheckedFeMale by remember{ mutableStateOf(false) } val context = LocalContext.current + val scrollState = rememberScrollState() LaunchedEffect(true) { effectFlow.collectLatest { effect -> @@ -69,6 +73,7 @@ fun OnBoardingUserInfoScreen( modifier = Modifier .fillMaxSize() .background(color = RemindTheme.colors.white) + .verticalScroll(scrollState) ) { BasicOnBoardingAppBar( modifier = Modifier.fillMaxWidth(), @@ -79,6 +84,7 @@ fun OnBoardingUserInfoScreen( modifier = Modifier .fillMaxSize() .padding(horizontal = 20.dp) + .weight(1f) ) { Text( modifier = Modifier.padding(top = 35.dp), @@ -246,19 +252,11 @@ fun OnBoardingUserInfoScreen( //유효성 통과 viewModel.setEvent( OnBoardingContract.Event.StoreUserInfoButtonClicked( - info = OnBoardingRequest( - centerName = "", - city = "", - district = "", - protectorPhoneNumber = "", - rolesType = uiState.selectedType!!, - fcmToken = "", - doctorLicenseNumber = textStates[fieldKeys[3]] ?: "", - birthday = textStates[fieldKeys[2]] ?: "", - phoneNumber = textStates[fieldKeys[1]] ?: "", - gender = if(isCheckedMale == true) "남" else "여", - name = textStates[fieldKeys[0]] ?: "" - ) + name = textStates[fieldKeys[0]] ?: "", + gender = if(isCheckedMale == true) "남" else "여", + phoneNumber = textStates[fieldKeys[1]] ?: "", + birthday = textStates[fieldKeys[2]] ?: "", + hospitalName = textStates[fieldKeys[3]] ?: "" ) ) } else { diff --git a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingViewModel.kt b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingViewModel.kt index 78524e1..03b471d 100644 --- a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingViewModel.kt +++ b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingViewModel.kt @@ -61,7 +61,11 @@ class OnBoardingViewModel @Inject constructor( updateState(currentState.copy( userInfo = currentState.userInfo.copy( fcmToken = currentState.fcmToken, - protectorPhoneNumber = event.number + protectorPhoneNumber = event.number, + doctorLicenseNumber = "", + district = "", + city = "", + centerName = "" ) )) postOnBoarding(currentState.userInfo) @@ -73,7 +77,12 @@ class OnBoardingViewModel @Inject constructor( viewModelScope.launch { updateState(currentState.copy( userInfo = currentState.userInfo.copy( - fcmToken = event.certifinumber + fcmToken = currentState.fcmToken, + doctorLicenseNumber = event.certifinumber, + protectorPhoneNumber = "", + district = "", + city = "", + centerName = "" ) )) postOnBoarding(currentState.userInfo) @@ -83,7 +92,14 @@ class OnBoardingViewModel @Inject constructor( //사용자 정보 작성하고 각자 입장의 온보딩으로 이동 is OnBoardingContract.Event.StoreUserInfoButtonClicked -> { updateState(currentState.copy( - userInfo = event.info + userInfo = currentState.userInfo.copy( + rolesType = currentState.selectedType!!, + name = event.name, + gender = event.gender, + phoneNumber = event.phoneNumber, + birthday = event.birthday, + hospitalName = event.hospitalName + ) )) navigateToNext(currentState.selectedType!!) } diff --git a/app/src/main/java/com/example/remind/feature/screens/center/CenterMainScreen.kt b/app/src/main/java/com/example/remind/feature/screens/center/CenterMainScreen.kt index 228c73d..d4c5332 100644 --- a/app/src/main/java/com/example/remind/feature/screens/center/CenterMainScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/center/CenterMainScreen.kt @@ -88,16 +88,34 @@ fun CenterMainScreen( // } // } // } + val imageIndex = remember { mutableStateOf(0) } RemindTheme { Column( - modifier = Modifier.fillMaxSize() + modifier = Modifier + .fillMaxWidth() + .background(color = RemindTheme.colors.white) ) { - Image( - modifier = Modifier.fillMaxWidth(), - painter = painterResource(id = R.drawable.ex_centermain), - contentScale = ContentScale.FillWidth, - contentDescription = null + MainAppBar( + modifier = Modifier.padding(top = 23.6.dp), + onClick = { + imageIndex.value = (imageIndex.value + 1) % 2 + } ) + if (imageIndex.value == 0) { + Image( + modifier = Modifier.fillMaxWidth(), + painter = painterResource(id = R.drawable.ex_center_main), + contentScale = ContentScale.FillWidth, + contentDescription = null + ) + } else { + Image( + modifier = Modifier.fillMaxWidth(), + painter = painterResource(id = R.drawable.ex_center_sub), + contentScale = ContentScale.FillWidth, + contentDescription = null + ) + } } } } diff --git a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMainScreen.kt b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMainScreen.kt index f07b714..3efbdf2 100644 --- a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMainScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMainScreen.kt @@ -78,7 +78,7 @@ fun DoctorMain( onClick = {} ) LazyColumn( - modifier = Modifier.padding(start = 26.dp, end = 28.dp), + modifier = Modifier.padding(start = 26.dp, end = 28.dp, top = 20.dp), ) { item { Profile( diff --git a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMoodChartScreen.kt b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMoodChartScreen.kt index 0da11e2..11c5d93 100644 --- a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMoodChartScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorMoodChartScreen.kt @@ -177,7 +177,21 @@ fun DoctorMoodChaartScreen( text = stringResource(id = R.string.무엇을_할_때_기분이_좋은지_확인), style = RemindTheme.typography.b2Medium.copy(color = RemindTheme.colors.grayscale_3) ) - //사진넣기 사진넣기 + Image( + modifier = Modifier.fillMaxWidth(), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_percentage), + contentDescription = null + ) + + Image( + modifier = Modifier + .fillMaxWidth() + .padding(top = 7.dp), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_activity), + contentDescription = null + ) Image( modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorNavGraph.kt b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorNavGraph.kt index 6b3ab14..2b7cdf7 100644 --- a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorNavGraph.kt +++ b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorNavGraph.kt @@ -1,36 +1,44 @@ package com.example.remind.feature.screens.doctor +import android.annotation.SuppressLint +import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.compose.composable import androidx.navigation.navigation import com.example.remind.app.Screens +@SuppressLint("UnrememberedGetBackStackEntry") fun NavGraphBuilder.DoctorGraph( navHostController: NavHostController, - doctorViewModel: DoctorViewModel + //doctorViewModel: DoctorViewModel ) { navigation( route = Screens.Doctor.route, startDestination = Screens.Doctor.DoctorMain.route ) { composable(route = Screens.Doctor.DoctorMain.route) { + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) DoctorMain(navHostController, doctorViewModel) } composable(route = Screens.Doctor.DoctorPatienceRegister.route) { - + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) DoctorRegisterScreen(navHostController, doctorViewModel) } composable(route = Screens.Doctor.PatienceManage.route) { + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) PatientManageScreen(navHostController, doctorViewModel) } composable(route = Screens.Doctor.PrescriptionUpdate.route) { + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) DoctorPrescriptionUpdateScreen(navHostController) } composable(route = Screens.Doctor.ManageMedicine.route) { + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) DoctorMedicineManage(navHostController, doctorViewModel) } composable(route = Screens.Doctor.ManageMood.route) { + val doctorViewModel: DoctorViewModel = hiltViewModel(navHostController.getBackStackEntry(Screens.Doctor.route)) DoctorMoodChaartScreen(navHostController, doctorViewModel) } composable(route = Screens.Doctor.ExDoctorBottomSheet.route) { diff --git a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorRegisterScreen.kt b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorRegisterScreen.kt index 655df55..b7a2fe7 100644 --- a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorRegisterScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorRegisterScreen.kt @@ -18,6 +18,8 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateMapOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip @@ -50,6 +52,7 @@ fun DoctorRegisterScreen( } } } + val acceptStatusMap = remember { mutableStateMapOf() } RemindTheme { Column( modifier = Modifier @@ -88,7 +91,7 @@ fun DoctorRegisterScreen( ) ) }, - status = uiState.connectionStatus + status = acceptStatusMap[item.memberId] ?: false ) } } @@ -155,7 +158,7 @@ fun RequestListItem( verticalAlignment = Alignment.CenterVertically ) { Text( - text = "${data.name} 환자(${data.gender})가 추가를 요청했습니다.", + text = "${data.name} 환자(${data.gender}, ${data.birthYear}년생)가 추가를 요청했습니다.", style = RemindTheme.typography.c1Medium.copy(color = RemindTheme.colors.text) ) Spacer(modifier = Modifier.weight(1f)) diff --git a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorViewModel.kt b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorViewModel.kt index e0ad6d9..7782ba1 100644 --- a/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorViewModel.kt +++ b/app/src/main/java/com/example/remind/feature/screens/doctor/DoctorViewModel.kt @@ -1,13 +1,11 @@ package com.example.remind.feature.screens.doctor -import android.util.Log import androidx.lifecycle.viewModelScope import androidx.navigation.navOptions import com.example.remind.app.Screens import com.example.remind.core.base.BaseViewModel import com.example.remind.data.model.request.SetAcceptrequest import com.example.remind.data.network.adapter.ApiResult -import com.example.remind.data.network.interceptor.TokenManager import com.example.remind.domain.usecase.doctor_usecase.GetDoctorMoodChartUseCase import com.example.remind.domain.usecase.doctor_usecase.GetPatientUseCase import com.example.remind.domain.usecase.doctor_usecase.GetRequestUseCase @@ -15,7 +13,6 @@ import com.example.remind.domain.usecase.onboarding_usecase.MemberInfoUseCase import com.example.remind.domain.usecase.patience_usecase.GetFeelingPercentUseCase import com.example.remind.domain.usecase.patience_usecase.GetMedicineRateUseCase import com.example.remind.domain.usecase.patience_usecase.GetMonthlyMedicineUseCase -import com.example.remind.domain.usecase.patience_usecase.GetMoodChartUseCase import com.example.remind.domain.usecase.patience_usecase.PrescriptionUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch @@ -27,7 +24,6 @@ class DoctorViewModel @Inject constructor( private val getPatientUseCase: GetPatientUseCase, private val getRequestUseCase: GetRequestUseCase, private val getMedicineRateUseCase: GetMedicineRateUseCase, - //private val getMoodChartUseCase: GetMoodChartUseCase, private val prescriptionUseCase: PrescriptionUseCase, private val getMonthlyMedicineUseCase: GetMonthlyMedicineUseCase, private val getFeelingPercentUseCase: GetFeelingPercentUseCase, @@ -43,10 +39,6 @@ class DoctorViewModel @Inject constructor( viewModelScope.launch { getPatients() getRequestPatients() - //getMedicineRate() - //getMoodChartData(year, month, date-6) - //getPrescription() - //getMonthMedicine() getFeelingPerCent() getMemberInfo() } diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/home/HomeViewModel.kt b/app/src/main/java/com/example/remind/feature/screens/patience/home/HomeViewModel.kt index b58e312..8c657f1 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/home/HomeViewModel.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/home/HomeViewModel.kt @@ -62,6 +62,11 @@ class HomeViewModel @Inject constructor( is HomeContract.Event.SendNotTakingReason -> { sendNotTakingReason(currentState.clickTime, currentState.notTakingReason ?: "") updateState(currentState.copy(medicineDialogState = false)) + navigateToRoute( + destination = Screens.Patience.Home.SplashCheering.route, + current = Screens.Patience.Home.route, + inclusiveData = true + ) } //미복용 사유 클릭 is HomeContract.Event.setNotTakingReason -> { diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmDialog.kt b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmDialog.kt index 09fe33c..88b5aed 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmDialog.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmDialog.kt @@ -70,6 +70,7 @@ fun AlarmContent( ) { Column { Row{ + Spacer(modifier = Modifier.weight(1f)) Text( modifier = Modifier .padding(top = 9.13.dp), @@ -77,7 +78,7 @@ fun AlarmContent( text = stringResource(id = R.string.알림_추가), style = RemindTheme.typography.b1Bold.copy(color = RemindTheme.colors.text) ) - + Spacer(modifier = Modifier.weight(1f)) Icon( modifier = modifier .padding(top = 8.83.dp, end = 11.dp) @@ -87,10 +88,16 @@ fun AlarmContent( contentDescription = null ) } - CustomTimePicker( - onTimeSelected = {}, - onDismissClick = onDismissClick - ) + Row( + modifier = Modifier.fillMaxWidth() + ) { + Spacer(modifier = Modifier.weight(1f)) + CustomTimePicker( + onTimeSelected = {}, + onDismissClick = onDismissClick + ) + Spacer(modifier = Modifier.weight(1f)) + } } } } diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmSettingScreen.kt b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmSettingScreen.kt index bad0b64..6b14bff 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmSettingScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/AlarmSettingScreen.kt @@ -107,12 +107,14 @@ fun AlarmSettingScreen( } Text( - modifier = Modifier.padding(top = 8.dp), + modifier = Modifier.padding(top = 8.dp, start = 20.dp), text = "알림을 통해 복용 시간을 놓치지 말아요!", style = RemindTheme.typography.c1Medium.copy(color = RemindTheme.colors.grayscale_3) ) Image( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth() + .padding(top = 14.dp), painter = painterResource(id = R.drawable.ex_alarm), contentDescription = null ) diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineScreen.kt b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineScreen.kt index 4b52aac..c4b2a40 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineScreen.kt @@ -53,6 +53,12 @@ fun MedicineScreen(navController: NavHostController, viewModel: MedicineViewMode val effectFlow = viewModel.effect val context = LocalContext.current val scrollState = rememberScrollState() + LaunchedEffect(Unit) { + viewModel.getPrescription() + viewModel.getMedicineRate() + viewModel.getMonthMedicine() + } + LaunchedEffect(true) { effectFlow.collectLatest { effect -> when(effect) { @@ -83,7 +89,7 @@ fun MedicineScreen(navController: NavHostController, viewModel: MedicineViewMode verticalAlignment = Alignment.CenterVertically ) { Text( - text = "${uiState.userName}님의 약 처방", + text = "${uiState.prescription.name}님의 약 처방", style = RemindTheme.typography.b2Bold.copy(color = RemindTheme.colors.text) ) Spacer(modifier = Modifier.weight(1f)) @@ -263,6 +269,10 @@ fun MedicineRateContainer( modifier: Modifier = Modifier, rate: Rate ) { + val total = "${String.format("%.1f", rate.totalRate)}%" + val breakfast = "${String.format("%.1f", rate.breakfastRate)}%" + val lunch = "${String.format("%.1f", rate.lunchRate)}%" + val dinner = "${String.format("%.1f", rate.dinnerRate)}%" Box( modifier = modifier .fillMaxWidth() @@ -278,7 +288,7 @@ fun MedicineRateContainer( ) { Row { Text( - text = String.format("%.1f", rate.totalRate), + text = total, style = RemindTheme.typography.h1Bold.copy(color= RemindTheme.colors.main_6) ) Text( @@ -297,8 +307,8 @@ fun MedicineRateContainer( style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.text) ) Text( - modifier = modifier.padding(start = 4.dp), - text = String.format("%.1f", rate.breakfastRate), + modifier = modifier.padding(start = 4.dp, end = 12.dp), + text = breakfast, style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.main_6) ) Text( @@ -306,8 +316,8 @@ fun MedicineRateContainer( style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.text) ) Text( - modifier = modifier.padding(start = 4.dp), - text = String.format("%.1f", rate.lunchRate), + modifier = modifier.padding(start = 4.dp, end = 12.dp), + text = lunch, style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.main_6) ) Text( @@ -315,8 +325,8 @@ fun MedicineRateContainer( style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.text) ) Text( - modifier = modifier.padding(start = 4.dp), - text = String.format("%.1f", rate.dinnerRate), + modifier = modifier.padding(start = 4.dp, end = 12.dp), + text = dinner, style = RemindTheme.typography.c2Medium.copy(color= RemindTheme.colors.main_6) ) } diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineViewModel.kt b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineViewModel.kt index 286b64f..4c06e21 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineViewModel.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/medicine/MedicineViewModel.kt @@ -53,7 +53,7 @@ class MedicineViewModel @Inject constructor( } - private fun getPrescription() { + fun getPrescription() { viewModelScope.launch { val result = prescriptionUseCase.invoke(0) when(result) { @@ -66,7 +66,7 @@ class MedicineViewModel @Inject constructor( } } } - private fun getMedicineRate() { + fun getMedicineRate() { viewModelScope.launch { val result = getMedicineRateUseCase.invoke(0) when(result){ @@ -80,7 +80,7 @@ class MedicineViewModel @Inject constructor( } } - private fun getMonthMedicine() { + fun getMonthMedicine() { viewModelScope.launch { val result = getMonthlyMedicineUseCase.invoke(0, 2024, 5) when(result) { diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/ExMoodChartBottomSheet.kt b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/ExMoodChartBottomSheet.kt index 774f71a..0a7a8ed 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/ExMoodChartBottomSheet.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/ExMoodChartBottomSheet.kt @@ -6,17 +6,17 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview import androidx.navigation.NavHostController import com.example.remind.R import com.example.remind.core.designsystem.theme.RemindTheme - @Composable fun ExMoodChartBottomSheet(navController: NavHostController) { RemindTheme { Image( modifier = Modifier.fillMaxSize(), painter = painterResource(id = R.drawable.ex_doctor_bottomsheet), - contentScale = ContentScale.FillWidth, + contentScale = ContentScale.FillBounds, contentDescription = null ) } diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartScreen.kt b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartScreen.kt index e94cde4..3f4395c 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartScreen.kt @@ -1,7 +1,5 @@ package com.example.remind.feature.screens.patience.moodchart -import android.content.Intent -import android.net.Uri import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -60,7 +58,6 @@ import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphStyle import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphVisibility import com.jaikeerthick.composable_graphs.style.LabelPosition import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch import java.time.LocalDate @OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterialApi::class) @Composable @@ -72,6 +69,9 @@ fun MoodChartScreen(navController: NavHostController, viewModel:MoodChartViewMod var isSheetOpen by rememberSaveable { mutableStateOf(false) } + val year = LocalDate.now().year + val month = LocalDate.now().monthValue + val date = LocalDate.now().dayOfMonth val coroutineScope = rememberCoroutineScope() val scrollState = rememberScrollState() val graphYaxisList = listOf( @@ -90,6 +90,11 @@ fun MoodChartScreen(navController: NavHostController, viewModel:MoodChartViewMod } ) } + LaunchedEffect(Unit) { + viewModel.getMoodChartData(year, month, date-6) + viewModel.getSeriesRecord() + } + LaunchedEffect(true) { effectFlow.collectLatest { effect -> when(effect) { @@ -217,27 +222,41 @@ fun MoodChartScreen(navController: NavHostController, viewModel:MoodChartViewMod text = stringResource(id = R.string.무엇을_할_때_기분이_좋은지_확인), style = RemindTheme.typography.b2Medium.copy(color = RemindTheme.colors.grayscale_3) ) - Box( - modifier = Modifier - .padding(top = 8.dp) - .border( - width = 1.dp, - color = RemindTheme.colors.grayscale_2, - shape = RoundedCornerShape(12.dp) - ) - ) { - if(uiState.feelingTotalPerCent.isNotEmpty()) { - FeelingPercentGraph( - modifier = Modifier.padding(top = 12.dp, bottom = 21.dp, start = 8.dp, end = 8.dp), - percentList = uiState.feelingTotalPerCent, - onClick = {} - ) - } else { - CircularProgressIndicator() - } +// Box( +// modifier = Modifier +// .padding(top = 8.dp) +// .border( +// width = 1.dp, +// color = RemindTheme.colors.grayscale_2, +// shape = RoundedCornerShape(12.dp) +// ) +// ) { +// if(uiState.feelingTotalPerCent.isNotEmpty()) { +// FeelingPercentGraph( +// modifier = Modifier.padding(top = 12.dp, bottom = 21.dp, start = 8.dp, end = 8.dp), +// percentList = uiState.feelingTotalPerCent, +// onClick = {} +// ) +// } else { +// CircularProgressIndicator() +// } +// +// } + Image( + modifier = Modifier.fillMaxWidth(), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_percentage), + contentDescription = null + ) - } - //활동 리스트들 들어가야함 + Image( + modifier = Modifier + .fillMaxWidth() + .padding(top = 7.dp), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_activity), + contentDescription = null + ) Text( modifier = Modifier.padding(top = 20.dp), text = stringResource(id = R.string.무드_차트_월별_비교) diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartViewModel.kt b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartViewModel.kt index e9508fb..63af5a8 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartViewModel.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/moodchart/MoodChartViewModel.kt @@ -60,7 +60,7 @@ class MoodChartViewModel @Inject constructor( } } - private fun getMoodChartData(year: Int, month: Int, day: Int) { + fun getMoodChartData(year: Int, month: Int, day: Int) { viewModelScope.launch { val result = getMoodChartUseCase.invoke(year, month, day, 7) when(result) { @@ -117,7 +117,7 @@ class MoodChartViewModel @Inject constructor( } } - private fun getSeriesRecord() { + fun getSeriesRecord() { viewModelScope.launch { val result = seriesRecordUseCase.invoke() when(result) { diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/mypage/MyPageScreen.kt b/app/src/main/java/com/example/remind/feature/screens/patience/mypage/MyPageScreen.kt index 1babc70..e3c1abf 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/mypage/MyPageScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/mypage/MyPageScreen.kt @@ -1,6 +1,7 @@ package com.example.remind.feature.screens.patience.mypage import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize @@ -10,6 +11,8 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale @@ -23,6 +26,7 @@ import com.example.remind.core.designsystem.theme.RemindTheme @Composable fun MyPageScreen(){ val scrollState = rememberScrollState() + val imageIndex = remember { mutableStateOf(0) } RemindTheme { Column( modifier = Modifier @@ -30,16 +34,28 @@ fun MyPageScreen(){ .verticalScroll(scrollState) ) { Text( - modifier = Modifier.padding(top = 19.6.dp, start = 24.dp), + modifier = Modifier + .padding(top = 19.6.dp, start = 24.dp) + .clickable(onClick = { imageIndex.value = (imageIndex.value + 1) % 2 }), text = "마이페이지", style = RemindTheme.typography.h2Bold.copy(color = RemindTheme.colors.text) ) - Image( - modifier = Modifier.fillMaxWidth(), - contentScale = ContentScale.FillWidth, - painter = painterResource(id = R.drawable.ex_mypage), - contentDescription = null - ) + if(imageIndex.value == 0) { + Image( + modifier = Modifier.fillMaxWidth(), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_mypage), + contentDescription = null + ) + } + else { + Image( + modifier = Modifier.fillMaxWidth(), + contentScale = ContentScale.FillWidth, + painter = painterResource(id = R.drawable.ex_mypage2), + contentDescription = null + ) + } } } } \ No newline at end of file diff --git a/app/src/main/res/drawable/ex_activity.png b/app/src/main/res/drawable/ex_activity.png new file mode 100644 index 0000000..e04e8bb Binary files /dev/null and b/app/src/main/res/drawable/ex_activity.png differ diff --git a/app/src/main/res/drawable/ex_center_main.png b/app/src/main/res/drawable/ex_center_main.png new file mode 100644 index 0000000..435e7d5 Binary files /dev/null and b/app/src/main/res/drawable/ex_center_main.png differ diff --git a/app/src/main/res/drawable/ex_center_sub.png b/app/src/main/res/drawable/ex_center_sub.png new file mode 100644 index 0000000..b52819b Binary files /dev/null and b/app/src/main/res/drawable/ex_center_sub.png differ diff --git a/app/src/main/res/drawable/ex_centermain.xml b/app/src/main/res/drawable/ex_centermain.xml deleted file mode 100644 index 39c2910..0000000 --- a/app/src/main/res/drawable/ex_centermain.xml +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ex_doctor_bottomsheet.png b/app/src/main/res/drawable/ex_doctor_bottomsheet.png index 44fba96..4c385c8 100644 Binary files a/app/src/main/res/drawable/ex_doctor_bottomsheet.png and b/app/src/main/res/drawable/ex_doctor_bottomsheet.png differ diff --git a/app/src/main/res/drawable/ex_home2.png b/app/src/main/res/drawable/ex_home2.png index bf83785..0e590c3 100644 Binary files a/app/src/main/res/drawable/ex_home2.png and b/app/src/main/res/drawable/ex_home2.png differ diff --git a/app/src/main/res/drawable/ex_home3.png b/app/src/main/res/drawable/ex_home3.png index 0f3a2a2..176acfe 100644 Binary files a/app/src/main/res/drawable/ex_home3.png and b/app/src/main/res/drawable/ex_home3.png differ diff --git a/app/src/main/res/drawable/ex_home4.png b/app/src/main/res/drawable/ex_home4.png index a5bb3f0..9edae8f 100644 Binary files a/app/src/main/res/drawable/ex_home4.png and b/app/src/main/res/drawable/ex_home4.png differ diff --git a/app/src/main/res/drawable/ex_mypage2.xml b/app/src/main/res/drawable/ex_mypage2.xml new file mode 100644 index 0000000..2df9273 --- /dev/null +++ b/app/src/main/res/drawable/ex_mypage2.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ex_percentage.png b/app/src/main/res/drawable/ex_percentage.png new file mode 100644 index 0000000..6fea127 Binary files /dev/null and b/app/src/main/res/drawable/ex_percentage.png differ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 80d9348..c4f0da0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -88,7 +88,7 @@ 오늘 하루,\n감사한 점 3가지를\n기록해 볼까요? 간단한 일기를 써도 좋아요:) 1.아름다운 벚꽃을 볼 수 있음에 감사해요.\n2.오늘 맛있는 빵을 먹어 감사해요.\n3.운동 할 수 있는 건강한 몸이 있음에 감사해요. - 무드 차트 월별 비동 + 무드 차트 월별 비교 주의관리 필요 환자 대처하기 보호자