Skip to content

Instantly share code, notes, and snippets.

@kalactor
Created May 30, 2023 06:45
Show Gist options
  • Save kalactor/1b689934392d07f1b366be7836cf90cc to your computer and use it in GitHub Desktop.
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
@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