makovkastar / FloatingActionButton

[DEPRECATED] Android floating action button
MIT License
4.01k stars 819 forks source link

Inconsistent view when a transparent background color is used #41

Open lpellegr opened 10 years ago

lpellegr commented 10 years ago

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

makovkastar commented 10 years ago

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

makovkastar commented 10 years ago

Added shadow image for xxxhdpi in 1e1b8d78d602c235f739ac5f0518627412b65bd.

makovkastar commented 9 years ago

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?

Iggy82 commented 9 years ago

@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.

makovkastar commented 9 years ago

@Iggy82 No, still no solution...

lordcodes commented 9 years ago

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?

Alvtag2 commented 8 years ago

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.