-
Notifications
You must be signed in to change notification settings - Fork 5
Drop shadows
Package: com.zedalpha.shadowgadgets.compose
As far as desired functionality, these should behave exactly like the originals, just with the content area clipped out.
The only functional differences would be bug fixes; e.g., at the time of writing
this, both original dropShadow() functions fail to update if you change the
shape. I mean circle to rectangle, not size changes. The library functions,
conversely, handle the shape correctly.
The "simple" version takes a Shadow object, and will recompose with every
change.
fun Modifier.clippedDropShadow(
shape: Shape,
shadow: Shadow
): ModifierIt is a drop-in replacement for Modifier.dropShadow.
The lambda version allows for updating shadow properties without recomposition.
fun Modifier.clippedDropShadow(
shape: Shape,
block: DropShadowScope.() -> Unit
): ModifierIt is a drop-in replacement for the Modifier.dropShadow.
An example of the lambda version can be found in
ComposeDropTopic.kt.