In our android app we need to create a floating action button which isn't the default circle but a square with with three rounded corners. The fab looks like in the image below:
I managed to create such a form but don't know how to apply it to my fab, or if it's even possible. The xml file for the shape looks like this:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/red" />
<corners
android:topLeftRadius="90dp"
android:topRightRadius="90dp"
android:bottomRightRadius="90dp"/>
</shape>
I tried to change the form with
android:src="@drawable/my_shape"
but this changes only the icon inside my button. I think I need to extend FloatingActionButton but I have no idea how.
Is there a way to change the shape of the fab? If someone has already achieved this I would appreciate to see a sample.