Skip to content

Instantly share code, notes, and snippets.

@ahmedrizwan
Last active May 27, 2020 11:15
Show Gist options
  • Save ahmedrizwan/d3078b7661c1ed14bd4d1fb48a342a5f to your computer and use it in GitHub Desktop.
Save ahmedrizwan/d3078b7661c1ed14bd4d1fb48a342a5f to your computer and use it in GitHub Desktop.
Jetpack Compose Calculator
setContent {
MaterialTheme(colors = lightThemeColors) {
WithConstraints { constraints, _ ->
val boxHeight = with(DensityAmbient.current) { constraints.maxHeight.toDp() }
val boxWidth = with(DensityAmbient.current) { constraints.maxWidth.toDp() }
Content(
constraints = constraints,
boxHeight = boxHeight,
boxWidth = boxWidth
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment