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.activity.enableEdgeToEdge
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.Canvas
|
import androidx.compose.foundation.Canvas
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@ -182,22 +183,43 @@ fun ResultScreen(bmi: Double, heightCm: Double, weightKg: Double) {
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
|
||||||
Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.Start) {
|
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_bmi_range))
|
||||||
ResultInfoLine(label = stringResource(R.string.healthy_weight_for_height, healthyWeightMin, healthyWeightMax))
|
ResultInfoLine(
|
||||||
|
label = stringResource(
|
||||||
|
R.string.healthy_weight_for_height,
|
||||||
|
healthyWeightMin,
|
||||||
|
healthyWeightMax
|
||||||
|
)
|
||||||
|
)
|
||||||
ResultInfoLine(label = stringResource(R.string.bmi_prime, bmiPrime))
|
ResultInfoLine(label = stringResource(R.string.bmi_prime, bmiPrime))
|
||||||
ResultInfoLine(label = stringResource(R.string.ponderal_index, ponderalIndex))
|
ResultInfoLine(label = stringResource(R.string.ponderal_index, ponderalIndex))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ResultInfoLine(label: String) {
|
fun ResultInfoLine(label: String) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(text = "• ", color = MaterialTheme.colorScheme.onSurface)
|
Text(
|
||||||
Text(text = label, style = MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.onSurface)
|
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
|
@Composable
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user