Created
September 11, 2023 20:05
-
-
Save zurche/5574c2f2a43a8227bd4b2cb845956d25 to your computer and use it in GitHub Desktop.
Performance Card Final
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
private val mockAssetInfo = AssetInfo( | |
R.drawable.amd_icon, | |
"Advanced Micro Devices, Inc.", | |
"AMD", | |
listOf( | |
113.518f, | |
113.799f, | |
113.333f, | |
113.235f, | |
114.099f, | |
113.506f, | |
113.985f, | |
114.212f, | |
114.125f, | |
113.531f, | |
114.228f, | |
113.284f, | |
114.031f, | |
113.493f, | |
113.112f | |
), | |
113.02211f, | |
1356.26f | |
) | |
@Composable | |
fun AssetPerformanceCard( | |
assetInfo: AssetInfo = mockAssetInfo | |
) { | |
Card( | |
modifier = Modifier | |
.wrapContentHeight() | |
.fillMaxWidth() | |
.padding(start = 5.dp, end = 5.dp, bottom = 5.dp), | |
colors = CardDefaults.cardColors(containerColor = CryptoWhite) | |
) { | |
Row( | |
horizontalArrangement = Arrangement.SpaceBetween, | |
verticalAlignment = Alignment.CenterVertically, | |
modifier = Modifier | |
.padding(15.dp) | |
.fillMaxWidth() | |
) { | |
AssetIcon(assetInfo.iconDrawable) | |
TickerName(assetInfo.name, assetInfo.tickerName) | |
PerformanceChart(Modifier.height(40.dp).width(90.dp), assetInfo.lastDayChange) | |
ValueView(assetInfo.currentValue, assetInfo.total) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment