Last active
June 21, 2023 20:09
-
-
Save zurche/11f5dc44f482fb92133ea599dc8c1da7 to your computer and use it in GitHub Desktop.
CryptoCardContent extraction
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
@Composable | |
private fun CryptoCardContent( | |
data: CryptoCardData, | |
textColor: Color | |
) { | |
Column( | |
verticalArrangement = Arrangement.SpaceBetween, | |
modifier = Modifier.size(150.dp) | |
) { | |
Row( | |
modifier = Modifier | |
.padding(12.dp) | |
.fillMaxWidth(), | |
horizontalArrangement = Arrangement.SpaceBetween | |
) { | |
Row { | |
Text( | |
text = "${data.valueChange}%", | |
color = textColor, | |
style = MaterialTheme.typography.labelMedium | |
) | |
ChangeIcon(data.valueChange) | |
} | |
Icon( | |
painter = painterResource(id = data.icon), | |
contentDescription = "Card Icon", | |
tint = Color.Black, | |
modifier = Modifier.size(20.dp) | |
) | |
} | |
Column( | |
verticalArrangement = Arrangement.SpaceAround, | |
modifier = Modifier.padding(12.dp) | |
) { | |
Text( | |
text = data.name, | |
color = textColor, | |
style = MaterialTheme.typography.labelMedium | |
) | |
Text( | |
text = "${data.value}", | |
color = textColor, | |
style = MaterialTheme.typography.headlineSmall | |
) | |
Text( | |
text = formatCurrentTotal(data.currentTotal), | |
color = textColor, | |
style = MaterialTheme.typography.bodySmall | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment