Adjust icon size of Floating action button (fab)

The new floating action button should be 56dp x 56dp and the icon inside it should be 24dp x 24dp. So the space between icon and button should be 16dp. <ImageButton android:id=”@+id/fab_add” android:layout_width=”56dp” android:layout_height=”56dp” android:layout_gravity=”bottom|right” android:layout_marginBottom=”16dp” android:layout_marginRight=”16dp” android:background=”@drawable/ripple_oval” android:elevation=”8dp” android:src=”https://stackoverflow.com/questions/27484126/@drawable/ic_add_black_48dp” /> ripple_oval.xml <ripple xmlns:android=”http://schemas.android.com/apk/res/android” android:color=”?android:colorControlHighlight”> <item> <shape android:shape=”oval”> <solid android:color=”?android:colorAccent” /> </shape> </item> </ripple> And … Read more

How can I add the new “Floating Action Button” between two widgets/layouts

I guess you have seen the new Android design guidelines, with the new “Floating Action Button” a.k.a “FAB” For instance this pink button: My question sounds stupid, and I have already tried a lot of things, but what is the best way to put this button at the intersection of two layouts? In the above … Read more

Android changing Floating Action Button color

I have been trying to change Material’s Floating Action Button color, but without success. <android.support.design.widget.FloatingActionButton android:id=”@+id/profile_edit_fab” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”end|bottom” android:layout_margin=”16dp” android:clickable=”true” android:src=”https://stackoverflow.com/questions/30969455/@drawable/ic_mode_edit_white_24dp” /> I have tried to add: android:background=”@color/mycolor” or via code: FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.profile_edit_fab); fab.setBackgroundColor(Color.parseColor(“#mycolor”)); or fab.setBackgroundDrawable(new ColorDrawable(Color.parseColor(“#mycolor”))); But none of the above worked. I have also tried the solutions in the … Read more