I am trying to change the shape of my action button from this default shape to a rectangle. Here is my xml:
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:cornerRadius="90dp"
android:text="@string/create_player_text"
android:fontFamily="@font/proximanova_semibold"
app:layout_constraintHorizontal_bias="0.99"
app:layout_constraintVertical_bias="0.01"/>
If you want to change the shape of the ExtendedFloatingActionButton
you can use the shapeAppearanceOverlay
attribute in the layout:
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlayExtended"
../>
With:
<style name="ShapeAppearanceOverlayExtended" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">0dp</item>
</style>
If you want a corner radius just change the value in the <item name="cornerSize">0dp</item>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With