material-components-android
material-components-android copied to clipboard
[ExtendedFloatingActionButton] width is larger than necessary for short text
trafficstars
Description: width is larger than necessary for short text, I tried a fixed width at first and it works but after using shrink() and extend() it goes back to the default width.
Expected behavior:
I resolved with android:minWidth="0dp"
Source code:
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="1"
android:textColor="@color/text_icons"
app:iconTint="@color/text_icons"
app:icon="@drawable/ic_refresh"
app:backgroundTint="@color/colorPrimary"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="26dp" />
Android API version: 34
Material Library version: 1.12.0 (same result on last version 1.13.0-alpha05)
Device: Pixel 7 pro (emulator)