How to make custom size of FloatingActionButton
Because I don't use FAB of mini
size, I redefined this size.
dimens.xml:
<resources>
<dimen name="design_fab_size_mini">100dp</dimen>
</resources>
layout.xml (first FAB will be bigger than second one):
<android.support.design.widget.FloatingActionButton
android:id="@+id/addPhoto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
app:fabSize="mini"
android:layout_marginBottom="@dimen/fab_margin_bottom"
android:layout_marginRight="@dimen/fab_margin_right"
android:src="@drawable/ic_photo_camera_white_24dp"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/addPicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/addPhoto"
android:layout_marginBottom="@dimen/fab_margin_bottom"
android:layout_marginRight="0dp"
android:src="@drawable/ic_photo_white_24dp"
/>
Since support library 27.1.0 there is an attribute for this:
Just set app:fabCustomSize