UTS-202310715082-FazriAbdurrahman
This commit is contained in:
parent
de59cc8f47
commit
bae6759c9d
@ -6,6 +6,7 @@ import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
@ -182,11 +183,24 @@ fun ResultScreen(bmi: Double, heightCm: Double, weightKg: Double) {
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.Start) {
|
||||
ResultInfoLine(label = stringResource(R.string.healthy_bmi_range))
|
||||
ResultInfoLine(label = stringResource(R.string.healthy_weight_for_height, healthyWeightMin, healthyWeightMax))
|
||||
ResultInfoLine(label = stringResource(R.string.bmi_prime, bmiPrime))
|
||||
ResultInfoLine(label = stringResource(R.string.ponderal_index, ponderalIndex))
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
shape = RoundedCornerShape(16.dp),
|
||||
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.3f),
|
||||
border = BorderStroke(1.dp, MaterialTheme.colorScheme.outline.copy(alpha = 0.5f))
|
||||
) {
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
ResultInfoLine(label = stringResource(R.string.healthy_bmi_range))
|
||||
ResultInfoLine(
|
||||
label = stringResource(
|
||||
R.string.healthy_weight_for_height,
|
||||
healthyWeightMin,
|
||||
healthyWeightMax
|
||||
)
|
||||
)
|
||||
ResultInfoLine(label = stringResource(R.string.bmi_prime, bmiPrime))
|
||||
ResultInfoLine(label = stringResource(R.string.ponderal_index, ponderalIndex))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -194,10 +208,18 @@ fun ResultScreen(bmi: Double, heightCm: Double, weightKg: Double) {
|
||||
@Composable
|
||||
fun ResultInfoLine(label: String) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(text = "• ", color = MaterialTheme.colorScheme.onSurface)
|
||||
Text(text = label, style = MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.onSurface)
|
||||
Text(
|
||||
text = "• ",
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.padding(end = 8.dp)
|
||||
)
|
||||
Text(
|
||||
text = label,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user