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 #15

Merged
merged 19 commits into from
May 22, 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
7 changes: 2 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<application
android:name=".app.App"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -25,18 +26,14 @@
android:theme="@style/AppTheme"
android:supportsRtl="true"
tools:targetApi="31" >
<meta-data
android:name="com.kakao.sdk.AppKey"
android:value="${kakaoKey}"/>
<activity
android:name=".app.MainActivity"
android:exported="true"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize"
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/example/remind/app/RemindNavHost.kt
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
package com.example.remind.app

import androidx.compose.runtime.Composable
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.remind.feature.screens.center.CenterGraph
import com.example.remind.feature.screens.doctor.DoctorGraph
import com.example.remind.feature.screens.patience.PatienceScreen
import com.example.remind.feature.screens.auth.RegisterGraph
import com.example.remind.feature.screens.auth.onboarding.OnBoardingViewModel
import com.example.remind.feature.screens.auth.splash.SplashGraph

@Composable
fun RemindNavHost() {
val navHostController = rememberNavController()
val onBoardingViewModel: OnBoardingViewModel = hiltViewModel()
NavHost(
navController = navHostController,
startDestination = Screens.Splash.route
) {
SplashGraph(navHostController)
RegisterGraph(navHostController)
RegisterGraph(navHostController, onBoardingViewModel)
composable(route = Screens.Patience.route) {
PatienceScreen()
}
DoctorGraph(navHostController)
CenterGraph(navHostController)
//WritingGraph(navHostController)
}
}

8 changes: 7 additions & 1 deletion app/src/main/java/com/example/remind/app/Screens.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sealed class Screens(val route: String) {
object Register: Screens("register") {
object Login: Screens("login")
object SelectType: Screens("selecttype")
object OnBoardingUserInfo: Screens("onboarding_userinfo")
object OnBoardingPatience: Screens("patience_onboarding")
object OnBoardingCheckDoctor: Screens("doctor_1")
object OnBoardingLoadingDoctor: Screens("doctor_2")
Expand All @@ -26,10 +27,15 @@ sealed class Screens(val route: String) {
object Home: Screens("HomeScreen") {
object WritingMoodStep1: Screens("writing_step1")
object WritingMoodStep2: Screens("writing_step2")
object WritingMoodStep2Feeling: Screens("writing_step2_1")
object WritingMoodStep2Last: Screens("writing_step2_2")
object WritingMoodStep3: Screens("writing_step3")
object SplashCheering: Screens("cheering")
}
object MoodChart: Screens("MoodChart")
object Medicine: Screens("Medicine")
object Medicine: Screens("Medicine") {
object AlarmSetting: Screens("alarm_setting")
}
object MyPage: Screens("MyPage")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.example.remind.core.common.component

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.unit.dp
import com.example.remind.core.designsystem.theme.RemindTheme

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun BasicBottomSheet(
modifier: Modifier = Modifier,
sheetState : SheetState = rememberModalBottomSheetState(),
onDismissRequest: () -> Unit,
sheetContent: @Composable ColumnScope.() -> Unit
) {
val configuration = LocalConfiguration.current
val screenHeight = configuration.screenHeightDp.dp
val modalHeight = screenHeight * 0.9f
ModalBottomSheet(
sheetState = sheetState,
onDismissRequest = onDismissRequest,
dragHandle = null,
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
containerColor = RemindTheme.colors.white,
scrimColor = RemindTheme.colors.black.copy(alpha = 0.4f)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.height(modalHeight)
.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))
) {
sheetContent()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.example.remind.core.common.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
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.unit.dp
import com.example.remind.core.designsystem.theme.RemindTheme
import com.example.remind.data.model.FeelingScoreModel

@Composable
fun IconContainer(
modifier: Modifier = Modifier,
feelingScoreModel: FeelingScoreModel,
backgroundColor: Color,
onClick: () -> Unit
) {
Box(
modifier = modifier
.background(color = backgroundColor, shape = RoundedCornerShape(16.dp))
.clickable(onClick = onClick)
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
Image(
modifier = Modifier
.padding(
top = 18.dp,
start = 15.dp,
end = 15.dp,
bottom = 16.dp
)
.size(
width = 25.dp,
height = 25.dp
),
painter = painterResource(id = feelingScoreModel.imgeRes),
contentDescription = null
)
Text(
modifier = modifier.padding(bottom = 15.dp),
text = feelingScoreModel.feeling,
style = RemindTheme.typography.c1Bold.copy(color = RemindTheme.colors.slate_700)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
Expand All @@ -31,21 +32,28 @@ fun MedicineItem(
score: Float,
doseClick: () -> Unit,
unadministeredClick: () -> Unit,
isTaking: Boolean,
isTakingTime: String,
notTakingReason: String
) {
Box(
modifier = modifier
.fillMaxWidth()
.background(color = RemindTheme.colors.slate_50, shape = RoundedCornerShape(12.dp))
) {
Column(
horizontalAlignment = Alignment.Start,
modifier = Modifier.fillMaxWidth()
) {
Text(
modifier = modifier.padding(start = 12.dp, top = 7.dp),
modifier = Modifier.padding(start = 12.dp, top = 7.dp),
text = time,
style = RemindTheme.typography.b3Bold.copy(color = RemindTheme.colors.slate_600)
)
Row(
modifier = modifier.padding(
modifier = Modifier
.fillMaxWidth()
.padding(
start = 12.dp,
end = 12.dp,
top = 2.dp,
Expand All @@ -56,40 +64,74 @@ fun MedicineItem(
text = stringResource(id = R.string.중요도),
style = RemindTheme.typography.c3Medium.copy(color = RemindTheme.colors.slate_400)
)
Spacer(modifier = modifier.width(6.dp))
Spacer(modifier = Modifier.width(6.dp))
StarRatingBar(
rating = score,
onRatingChanged = {}
)
}
Spacer(modifier = modifier.height(4.dp))
Row() {
//시간이 정해져있을 경우 바꿔지도록 하기
Spacer(modifier = Modifier.height(4.dp))
if(isTaking == false && notTakingReason == "") {
Row(
modifier = Modifier.fillMaxWidth()
) {
Text(
modifier = Modifier
.weight(0.5f)
.background(
color = RemindTheme.colors.main_6,
shape = RoundedCornerShape(bottomStart = 12.dp)
)
.clickable { doseClick() },
text = stringResource(id = R.string.복용),
textAlign= TextAlign.Center,
style = RemindTheme.typography.c1Bold.copy(
color = RemindTheme.colors.white,
lineHeight = 20.sp
)
)
Spacer(modifier = Modifier.width(2.dp))
Text(
modifier = Modifier
.weight(0.5f)
.background(
color = RemindTheme.colors.main_5,
shape = RoundedCornerShape(bottomEnd = 12.dp)
)
.clickable { unadministeredClick() },
text = stringResource(id = R.string.미복용),
textAlign= TextAlign.Center,
style = RemindTheme.typography.c1Bold.copy(
color = RemindTheme.colors.white,
lineHeight = 20.sp
)
)
}
} else if(isTaking == false && notTakingReason != "") {
Text(
modifier = modifier
.weight(0.5f)
modifier = Modifier
.fillMaxWidth()
.background(
color = RemindTheme.colors.main_6,
shape = RoundedCornerShape(bottomStart = 12.dp)
)
.clickable { doseClick },
text = stringResource(id = R.string.복용),
color = RemindTheme.colors.slate_500,
shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp)
),
text = "미복용",
textAlign= TextAlign.Center,
style = RemindTheme.typography.c1Bold.copy(
color = RemindTheme.colors.white,
lineHeight = 20.sp
)
)
Spacer(modifier = modifier.width(2.dp))
}
else {
Text(
modifier = modifier
.weight(0.5f)
modifier = Modifier
.fillMaxWidth()
.background(
color = RemindTheme.colors.main_5,
shape = RoundedCornerShape(bottomEnd = 12.dp)
)
.clickable { unadministeredClick },
text = stringResource(id = R.string.미복용),
color = RemindTheme.colors.slate_500,
shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp)
),
text = isTakingTime,
textAlign= TextAlign.Center,
style = RemindTheme.typography.c1Bold.copy(
color = RemindTheme.colors.white,
Expand All @@ -104,5 +146,5 @@ fun MedicineItem(
@Preview
@Composable
fun ItemPreview() {
MedicineItem(time = "아침", score= 2.0f, doseClick = {}, unadministeredClick = {})
MedicineItem(time = "아침", score= 2.0f, doseClick = {}, unadministeredClick = {}, isTaking = true, isTakingTime = "", notTakingReason = "")
}
Loading
Loading