FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

Inconsistent view when a transparent background color is used

Open laurentpellegrino opened this issue 11 years ago • 7 comments

Using a background color with some alpha (e.g. #99fe0038) when the shadow attribute value is set to true reveals two circles: one for the floating action button and another inside (cf. image below). The latter is probably caused by the shape of the drawable that is used for creating the shadow.

It would be nice to get a circle without the inner one when a transparent background color is used.

I have also noticed that the image drawable used for the shadow isn't provided for xxxhdpi.

device-2014-11-01-182232

laurentpellegrino avatar Nov 01 '14 17:11 laurentpellegrino

I've asked @PaulMaddox to provide a shadow image for xxxhdpi. Regarding weird two circles I'll take a look.

makovkastar avatar Nov 02 '14 18:11 makovkastar

Added shadow image for xxxhdpi in 1e1b8d78d602c235f739ac5f0518627412b65bd.

makovkastar avatar Nov 08 '14 18:11 makovkastar

It seems nobody knows what causes this bug. I posted a question http://stackoverflow.com/questions/26960939/elevation-transparency-bug-on-android-lollipop but got no answers.

Can it be an Android bug?

makovkastar avatar Nov 19 '14 11:11 makovkastar

@makovkastar Is there still no solution for this problem? This could be a big problem on Android 5 devices as I'm also using a transparent background. I hope you will find a solution. Thank you.

Iggy82 avatar Nov 25 '14 21:11 Iggy82

@Iggy82 No, still no solution...

makovkastar avatar Nov 25 '14 21:11 makovkastar

https://code.google.com/p/android/issues/detail?id=78248

Android bug seems to mention elevation not working correctly with translucent background. It might be related?

lordcodes avatar Mar 04 '15 21:03 lordcodes

Hi, been running into this problem this morning. as far as I can tell, android draws a flat shadow gradient "border", then lays out content to straddle that gradient. looks great for solid color content, but transparencies allow you to see through that content and see the entire shadow gradient. i think a custom asset as makovkastar commented on Nov 8, 2014 is the only way to use transparent content with pseudo elevation.

Alvtag2 avatar Jul 21 '16 19:07 Alvtag2