Elevation + transparency bug on Android Lollipop

1.1k views Asked by At

Using a background color for a view with some alpha (e.g. #99fe0038) and some elevation on API 21 reveals two circles: one for the view itself and another inside:

Elevation and background color are set via code:

view.setElevation(getResources().getDimensionPixelSize(R.dimen.fab_elevation_lollipop));
view.setBackgroundColor(Color.parseColor("#99fe0038"));

Without setting elevation or with using an opaque color everything looks like expected.

Is it an Android bug or have I missed something here?

1

There are 1 answers

0
ajoe On

Removing shadow effect worked for me.

FAB.setShadow(false);        
FAB.setBackgroundColor(getResources().getColor(R.color.fab_transparent));