Skip to content

Instantly share code, notes, and snippets.

@KatieBarnett
Created August 13, 2023 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KatieBarnett/9d6f81b31cd15148bed37b699773f37f to your computer and use it in GitHub Desktop.
Save KatieBarnett/9d6f81b31cd15148bed37b699773f37f to your computer and use it in GitHub Desktop.
ComplexModifierScene - Unedited
@Composable
fun ComplexModifierScene(
nighttime: Boolean,
torchon: Boolean,
modifier: Modifier = Modifier
) {
val boxModifier = if (nighttime && torchon) {
modifier
.clip(CircleShape)
.fillMaxHeight()
.aspectRatio(1f)
.background(TorchLight)
.shadow(elevation = 4.dp, shape = CircleShape)
} else if (!nighttime) {
modifier
.fillMaxHeight()
.aspectRatio(1f)
.background(Sunlight)
} else {
modifier
.fillMaxHeight()
.aspectRatio(1f)
.background(Night)
.blur(20.dp)
}
Box(boxModifier) {
Image(painterResource(R.drawable.outline_yard_24), "Scene", Modifier.fillMaxSize())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment