I have a list of items with a custom background. The background is a simple shape with rounded-rect drawable filled with white color. So my view is similar to a Card. I can
I believe this to be related to a known issue in Lollipop https://code.google.com/p/android/issues/detail?id=78248
Thanks for the report and repro steps - this is indeed a bug, and it has just been fixed in an internal branch. Will be released externally in a future release.
As a workaround, you can either set an alpha on the GradientDrawable, or set a custom outline provider on the view casting the shadow (via View#setOutlineProvider) to query the outline from the background and override the alpha provided by the drawable.
The issue was that GradientDrawable was being too conservative in reporting a 0 alpha in cases where it had a transparent fill. (See GradientDrawable#getOutline(), for the curious)