The code for FAB:
The accepted answer is working fine but after adding the below line, it stretches the icon added on FAB
56dp
I am sharing the screenshots:
Previous FAB button
After adding design_fab_image_size in dimen.xml and adding android:src="@drawable/gradient", the icon get stretched:
To deal with this I replaced my gradient.xml with the following code:
-
-
-
Output: