Created
May 30, 2023 06:45
-
-
Save kalactor/1b689934392d07f1b366be7836cf90cc to your computer and use it in GitHub Desktop.
Complete code for matchParentSize modifier that is used in the advanced jetpack compose modifier post of my website named jetpackcomposeworld.com
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 MatchParentSizeModifier(modifier: Modifier) { | |
Box { | |
Spacer( | |
modifier = Modifier | |
.matchParentSize() | |
.background(Color.Gray) | |
) | |
WebsiteNameShower() | |
} | |
} | |
@Composable | |
fun WebsiteNameShower() { | |
Text( | |
text = "Jetpack Compose World", | |
modifier = Modifier | |
.padding(16.dp) | |
.background(color = Color.Green), | |
fontSize = 32.sp, | |
fontStyle = FontStyle.Italic, | |
textDecoration = TextDecoration.Underline | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment