makovkastar/FloatingActionButton

Background not fully filled on KitKat

baolongnt opened this issue · 1 comments

screen shot 2015-06-11 at 6 03 06 pm

Not sure if it's a bug in the lib or my code. It works fine (of course) on Lollipop. On KitKat I get the attached screenshot. Here is my code (custom ViewGroup so no XML layout). Also, the theme is derived from Holo and I am not used appcompat activities or fragment

        mSelfieFab = new FloatingActionButton(context);
        mSelfieFab.setImageDrawable(
                getResources().getDrawable(R.drawable.sidenav_icon_photo_finish));
        mSelfieFab.setType(FloatingActionButton.TYPE_MINI);
        mSelfieFab.setColorNormal(getResources().getColor(R.color.basis_red));
        mSelfieFab.setColorPressed(getResources().getColor(R.color.basis_red_pressed));

It turns out to be a bug in my layout code. I assumed that the size of the button would always be 56dp (normal) or 40dp. However, in Kitkat, the actual size is bigger because of the shadow added when implementing the elevation.