Skip to content

Instantly share code, notes, and snippets.

@devDeejay
Created October 2, 2021 19:39
Show Gist options
  • Save devDeejay/83d3be403b1b5b37a7e3dc45531314ea to your computer and use it in GitHub Desktop.
Save devDeejay/83d3be403b1b5b37a7e3dc45531314ea to your computer and use it in GitHub Desktop.
@Composable
fun GreetUser(name: String) {
// Adding a modifier to our Row
Row(modifier = Modifier.padding(all = 8.dp)) {
Image(
painter = painterResource(
id = R.drawable.ic_launcher_background
), contentDescription = "Some cool image",
// Image Modifier
modifier = Modifier
// Set image size to 40 dp
.size(48.dp)
// Clip image to be shaped as a circle
.clip(CircleShape)
)
// Adding a horizontal space between the image and the column
Spacer(modifier = Modifier.width(8.dp))
Column {
Text(text = "Hello!")
// Adding a vertical space
Spacer(modifier = Modifier.height(4.dp))
Text(text = name)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment