Skip to content

Instantly share code, notes, and snippets.

@azazellj
Created June 12, 2024 09:38
Show Gist options
  • Save azazellj/8f4b2f7c1a71741c2ac56f0e9eb54dc7 to your computer and use it in GitHub Desktop.
Save azazellj/8f4b2f7c1a71741c2ac56f0e9eb54dc7 to your computer and use it in GitHub Desktop.
Component with image link as a paramater
@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