6

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?

comrade
  • 4,590
  • 5
  • 33
  • 48
makovkastar
  • 5,000
  • 2
  • 30
  • 50
  • Still happening on API 24 and 26 (real device and emulator)... this is the only link I found related to this issue, no body seems to have a solution... Got here actually from your GitHub: https://github.com/makovkastar/FloatingActionButton/issues/41 – Hugo Allexis Cardona Oct 17 '17 at 03:25

1 Answers1

0

Removing shadow effect worked for me.

FAB.setShadow(false);        
FAB.setBackgroundColor(getResources().getColor(R.color.fab_transparent));
Gustavo Morales
  • 2,614
  • 9
  • 29
  • 37
ajoe
  • 1
  • 2