Created
June 12, 2024 09:38
-
-
Save azazellj/8f4b2f7c1a71741c2ac56f0e9eb54dc7 to your computer and use it in GitHub Desktop.
Component with image link as a paramater
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 | |
fun ContactFullNameV1View( | |
imageUrl: String, | |
fullName: String, | |
modifier: Modifier = Modifier, | |
) { | |
Row( | |
modifier = modifier | |
.sizeIn( | |
minHeight = 56.dp, | |
) | |
.padding( | |
horizontal = 16.dp, | |
vertical = 8.dp, | |
), | |
horizontalArrangement = Arrangement.spacedBy( | |
space = 16.dp, | |
), | |
) { | |
Image( | |
painter = rememberAsyncImagePainter(model = imageUrl), | |
contentDescription = "contact image", | |
modifier = Modifier | |
.requiredSize(40.dp), | |
) | |
Text( | |
text = fullName, | |
modifier = Modifier | |
.align(Alignment.CenterVertically), | |
color = MaterialTheme.colorScheme.onSurface, | |
style = MaterialTheme.typography.bodyMedium, | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment