androidandroiddesignsupportfloating-action-button

Floating Action Button rectangular shaped (round corners) with text


I was wondering whether it could be possible to create a fab like this shown in this image from material.io and how to create it. Thanks

enter image description here


Solution

  • Try this:

    <com.google.android.material.button.MaterialButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:icon="@drawable/ic_play_white"
        app:cornerRadius="20dp"
        android:text="Test" />