Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
๐Ÿ”€ :: (#156) ์šฐ์šธ์ฆ ์ˆ˜์น˜ ์ •๋ณด ๊ตฌํ˜„
Browse files Browse the repository at this point in the history
๐Ÿ”€ :: (#156) ์šฐ์šธ์ฆ ์ˆ˜์น˜ ์ •๋ณด ๊ตฌํ˜„
  • Loading branch information
chlgkdms authored Dec 7, 2023
2 parents 25a8bf8 + b62a256 commit 54b1a92
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ object SignalColor {

@Stable
val Black = Color(0xFF000000)

@Stable
val Wine = Color(0xFFAF0000)

@Stable
val Yellow = Color(0xFFFFE040)
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal fun Diary(
var dayState by remember { mutableStateOf(formatter.format(date).split("-").last()) }

LaunchedEffect("$yearState-$monthState-$dayState") {
diaryViewModel.setDate("$yearState-$monthState-$dayState")
diaryViewModel.setDate("$yearState-$monthState-${dayState.padStart(2, '0')}")
diaryViewModel.fetchDayDiary()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import coil.compose.AsyncImage
import com.patrykandpatrick.vico.compose.axis.horizontal.rememberBottomAxis
import com.patrykandpatrick.vico.compose.axis.vertical.rememberStartAxis
Expand Down Expand Up @@ -72,6 +74,12 @@ internal fun Home(
val showDialog = { dialogState = true }
val hideDialog = { dialogState = false }

if (dialogState) {
Dialog(onDismissRequest = { dialogState = false }) {
ChartInformationDialog()
}
}

Column {
Column(modifier = Modifier.padding(horizontal = 16.dp)) {
Spacer(modifier = Modifier.height(30.dp))
Expand Down Expand Up @@ -160,6 +168,74 @@ internal fun Home(
}
}

@Composable
private fun ChartInformationDialog() {
Column(
modifier = Modifier
.background(
color = SignalColor.White,
shape = RoundedCornerShape(6.dp),
)
.padding(
horizontal = 55.dp,
vertical = 30.dp,
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
BodyLarge2(
text = stringResource(id = R.string.home_information_title),
color = SignalColor.Black,
)
Body(
modifier = Modifier.padding(bottom = 30.dp),
text = stringResource(id = R.string.home_information_description),
color = SignalColor.Gray500,
)
ChartInformationText(
scoreName = stringResource(id = R.string.home_very_high),
scoreNameColor = SignalColor.Wine,
score = stringResource(id = R.string.home_very_high_score),
)
ChartInformationText(
scoreName = stringResource(id = R.string.home_high),
scoreNameColor = SignalColor.Error,
score = stringResource(id = R.string.home_high_score),
)
ChartInformationText(
scoreName = stringResource(id = R.string.home_normal),
scoreNameColor = SignalColor.Yellow,
score = stringResource(id = R.string.home_normal_score),
)
ChartInformationText(
scoreName = stringResource(id = R.string.home_low),
scoreNameColor = SignalColor.Primary100,
score = stringResource(id = R.string.home_low_score),
)
}
}

@Composable
private fun ChartInformationText(
scoreName: String,
scoreNameColor: Color,
score: String,
) {
Row(
modifier = Modifier.fillMaxWidth(0.8f),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
BodyStrong(
text = scoreName,
color = scoreNameColor,
)
Body(
text = score,
color = SignalColor.Black,
)
}
}

@Composable
private fun OngoingActivity(
title: String,
Expand Down
12 changes: 12 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@
<string name="home_diagnosis_history_null">๋ฐ์ดํ„ฐ๊ฐ€ ๋ถ€์กฑํ•ด์š”!</string>

<string name="home_information_icon">์šฐ์šธ๊ฐ ์ˆ˜์น˜ ๊ทธ๋ž˜ํ”„ ์ •๋ณด ์•„์ด์ฝ˜</string>
<string name="home_information_title">์šฐ์šธ์ฆ ์ˆ˜์น˜ ์ •๋ณด</string>
<string name="home_information_description">์šฐ์šธ์ฆ ์ˆ˜์น˜์— ๊ด€ํ•œ ์ •๋ณด๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.</string>

<string name="home_very_high">๋งค์šฐ ๋†’์Œ</string>
<string name="home_high">๋†’์Œ</string>
<string name="home_normal">๋ณดํ†ต</string>
<string name="home_low">๋‚ฎ์Œ</string>

<string name="home_very_high_score">45 ~ 60</string>
<string name="home_high_score">30 ~ 45</string>
<string name="home_normal_score">15 ~ 30</string>
<string name="home_low_score">0 ~ 15</string>

<!--my page-->
<string name="my_page_profile_image">ํ”„๋กœํ•„ ์‚ฌ์ง„</string>
Expand Down

0 comments on commit 54b1a92

Please sign in to comment.