https://kotlinlang.org logo
Title
s

spierce7

01/05/2022, 4:32 PM
I’m making an app in compose - and the designs use these shadows in many places, where they surround the outside of the component and then fade. What is the best way to achieve this in Compose?
r

Rafael Costa

01/05/2022, 5:39 PM
Check the Composable "Card"
It will be a good start 🙂
s

spierce7

01/05/2022, 5:42 PM
That’s what I’m using now. All that I can do with that is play with
elevation
. It doesn’t match the shadow.
r

Rafael Costa

01/05/2022, 5:43 PM
Maybe you can look at Card internals to see how they achieve that look, and then create your own composable with more parameters 😉
I know its not much help sorry, but its all I have 😄
s

spierce7

01/06/2022, 4:54 AM
😄
I found this is a common problem. There is a highly upvoted issue with this - https://issuetracker.google.com/issues/160665122?pli=1
j

JulianK

01/06/2022, 7:07 AM
There's this gist https://gist.github.com/cedrickring/0497965b0658d6727aaec531f59e8c5c suggesting how you can draw your own shadows. Also, I'd just use elevation and ignore the design requirements 😈