-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Team-ReMind/feat/onboarding
Feat/onboarding-환자용 온보딩 완료
- Loading branch information
Showing
70 changed files
with
2,540 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/src/main/java/com/example/remind/core/common/component/BasicOnBoardingAppBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.example.remind.core.common.component | ||
|
||
import androidx.compose.foundation.background | ||
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.shape.RoundedCornerShape | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import com.example.remind.R | ||
import com.example.remind.core.designsystem.theme.RemindTheme | ||
|
||
@Composable | ||
fun BasicOnBoardingAppBar( | ||
modifier : Modifier = Modifier, | ||
weight: Float, | ||
title: String | ||
) { | ||
Column( | ||
modifier = modifier.fillMaxWidth() | ||
) { | ||
Text( | ||
modifier = modifier.padding(top = 20.dp, bottom = 16.dp), | ||
textAlign = TextAlign.Center, | ||
text = title, | ||
style = RemindTheme.typography.b1Bold.copy(color = RemindTheme.colors.text) | ||
) | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
) { | ||
Box( | ||
modifier = modifier | ||
.weight(weight) | ||
.height(4.dp) | ||
.padding(start = 0.dp) | ||
.clip(shape = RoundedCornerShape(23.dp)) | ||
.background(color = RemindTheme.colors.main_6) | ||
) | ||
Spacer(modifier = modifier.weight(0.7f)) | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/example/remind/core/common/component/BasicTextButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.example.remind.core.common.component | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.PlatformTextStyle | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.LineHeightStyle | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.example.remind.core.designsystem.theme.Pretendard | ||
import com.example.remind.core.designsystem.theme.RemindTheme | ||
|
||
@Composable | ||
fun BasicTextButton( | ||
modifier: Modifier = Modifier, | ||
backgroundColor: Color, | ||
text: String, | ||
textColor: Color, | ||
onClick: () -> Unit, | ||
verticalPadding: Dp, | ||
enable: Boolean | ||
) { | ||
Box( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.clip(RoundedCornerShape(12.dp)) | ||
.background(color = backgroundColor) | ||
.clickable( | ||
enabled = enable, | ||
onClick = onClick | ||
) | ||
) { | ||
Text( | ||
modifier = modifier | ||
.padding(vertical = verticalPadding), | ||
text = text, | ||
textAlign = TextAlign.Center, | ||
style = RemindTheme.typography.c1Medium.copy(color = textColor) | ||
) | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
app/src/main/java/com/example/remind/core/common/component/MedicineItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package com.example.remind.core.common.component | ||
|
||
import androidx.compose.foundation.background | ||
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.Spacer | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.example.remind.R | ||
import com.example.remind.core.designsystem.theme.RemindTheme | ||
|
||
@Composable | ||
fun MedicineItem( | ||
modifier: Modifier = Modifier, | ||
time: String, | ||
score: Float, | ||
doseClick: () -> Unit, | ||
unadministeredClick: () -> Unit, | ||
) { | ||
Box( | ||
modifier = modifier | ||
.background(color = RemindTheme.colors.slate_50, shape = RoundedCornerShape(12.dp)) | ||
) { | ||
Column( | ||
horizontalAlignment = Alignment.Start, | ||
) { | ||
Text( | ||
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( | ||
start = 12.dp, | ||
end = 12.dp, | ||
top = 2.dp, | ||
bottom = 4.dp | ||
) | ||
) { | ||
Text( | ||
text = stringResource(id = R.string.중요도), | ||
style = RemindTheme.typography.c3Medium.copy(color = RemindTheme.colors.slate_400) | ||
) | ||
Spacer(modifier = modifier.width(6.dp)) | ||
StarRatingBar( | ||
rating = score, | ||
onRatingChanged = {} | ||
) | ||
} | ||
Spacer(modifier = modifier.height(4.dp)) | ||
Row() { | ||
//시간이 정해져있을 경우 바꿔지도록 하기 | ||
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 | ||
) | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun ItemPreview() { | ||
//MedicineItem(time = "아침", score= 2.0, doseClick = {}, unadministeredClick = {}) | ||
} |
58 changes: 58 additions & 0 deletions
58
app/src/main/java/com/example/remind/core/common/component/StarRatingBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.selection.selectable | ||
import androidx.compose.foundation.selection.selectableGroup | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.platform.LocalDensity | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.unit.dp | ||
import com.example.remind.R | ||
import com.example.remind.core.designsystem.theme.RemindTheme | ||
|
||
@Composable | ||
fun StarRatingBar( | ||
maxStars: Int = 3, | ||
rating: Float, | ||
onRatingChanged: (Float) -> Unit | ||
) { | ||
val density = LocalDensity.current.density | ||
val starSize = (12f * density).dp | ||
val starSpacing = (0.5f * density).dp | ||
|
||
Row( | ||
modifier = Modifier.selectableGroup(), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
for (i in 1..maxStars) { | ||
val isSelected = i <= rating | ||
val icon = if (isSelected) R.drawable.ic_star_fill else R.drawable.ic_star_unfill | ||
val iconTintColor = if (isSelected) RemindTheme.colors.main_4 else RemindTheme.colors.slate_200 | ||
Icon( | ||
painter = painterResource(id = icon), | ||
contentDescription = null, | ||
tint = iconTintColor, | ||
modifier = Modifier | ||
.selectable( | ||
selected = isSelected, | ||
onClick = { | ||
onRatingChanged(i.toFloat()) | ||
} | ||
) | ||
.width(starSize) | ||
.height(starSize) | ||
) | ||
|
||
if (i < maxStars) { | ||
Spacer(modifier = Modifier.width(starSpacing)) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.