File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
library/src/main/java/com/leinardi/android/speeddial Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1919import android .content .Context ;
2020import android .content .res .ColorStateList ;
2121import android .content .res .TypedArray ;
22+ import android .graphics .Bitmap ;
2223import android .graphics .Rect ;
2324import android .graphics .drawable .Drawable ;
2425import android .os .Build ;
@@ -806,7 +807,10 @@ private void toggle(boolean show, boolean animate) {
806807 private void updateMainFabDrawable (boolean animate ) {
807808 if (isOpen ()) {
808809 if (mMainFabOpenedDrawable != null ) {
809- mMainFab .setImageDrawable (mMainFabOpenedDrawable );
810+ // This is a workaround. I don't know why if I set directly the rotated Drawable with `setImageDrawable`
811+ // it will be transparent/empty on Android API 16 (works on API 27, haven't tested other versions).
812+ Bitmap bitmap = UiUtils .getBitmapFromDrawable (mMainFabOpenedDrawable );
813+ mMainFab .setImageBitmap (bitmap );
810814 }
811815 UiUtils .rotateForward (mMainFab , getMainFabAnimationRotateAngle (), animate );
812816 } else {
You can’t perform that action at this time.
0 commit comments