Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/onboarding other #17

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -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"
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/example/remind/app/RemindNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,7 +27,7 @@ fun RemindNavHost() {
composable(route = Screens.Patience.route) {
PatienceScreen()
}
DoctorGraph(navHostController,doctorViewModel)
DoctorGraph(navHostController)
CenterGraph(navHostController)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "",
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ data class Prescription(
val period: Int = 0,
val prescriptionDate: String = "",
val prescriptionId: Int = 0
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface AuthService {
@Body body: KakaoLoginRequest
): ApiResult<SocialLoginResponse>

@POST("/prescription/relation/accept")
@POST("/member/onboarding")
suspend fun OnBoarding(
@Body body: OnBoardingRequest
): ApiResult<OnBoardingResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
}
Expand All @@ -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)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ 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
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
Expand Down Expand Up @@ -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 ->
Expand All @@ -69,6 +73,7 @@ fun OnBoardingUserInfoScreen(
modifier = Modifier
.fillMaxSize()
.background(color = RemindTheme.colors.white)
.verticalScroll(scrollState)
) {
BasicOnBoardingAppBar(
modifier = Modifier.fillMaxWidth(),
Expand All @@ -79,6 +84,7 @@ fun OnBoardingUserInfoScreen(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 20.dp)
.weight(1f)
) {
Text(
modifier = Modifier.padding(top = 35.dp),
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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!!)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,6 +52,7 @@ fun DoctorRegisterScreen(
}
}
}
val acceptStatusMap = remember { mutableStateMapOf<Int, Boolean>() }
RemindTheme {
Column(
modifier = Modifier
Expand Down Expand Up @@ -88,7 +91,7 @@ fun DoctorRegisterScreen(
)
)
},
status = uiState.connectionStatus
status = acceptStatusMap[item.memberId] ?: false
)
}
}
Expand Down Expand Up @@ -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))
Expand Down
Loading
Loading