Created
October 2, 2021 19:39
-
-
Save devDeejay/83d3be403b1b5b37a7e3dc45531314ea to your computer and use it in GitHub Desktop.
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 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