Ok, so I finally were able do a custom shadow modi...
# compose-android
j
Ok, so I finally were able do a custom shadow modifier using shadow layers, which maps 1:1 in Figma and Box shadows. Worth mention is shadows in design system render 3 or 4 shadows in a stack.
Copy code
canvas.drawOutline(outline = shadowOutline, paint = Paint().also { paint ->
                         paint.asFrameworkPaint().apply {
                             this.color = Color.Transparent.toArgb()
                             setShadowLayer(
                                 blurRadius.toPx(),
                                 offset.x.toPx() - spreadRadiusPx,
                                 offset.y.toPx() - spreadRadiusPx,
                                 color.toArgb(),
                             )
                         }
                     })
However it looks like if I use a list of items all shadows inside AnimatedContent. When animation enter items it does that before shadow rendering. Looks like it flickering. Is there anything I need tweak. Like merge all layers. My minimum Android version is 10, so I should be quite free use more latest canvas and shadow stuff?