I want to show only my drawable icon in FloatingActionButton (for min 14 API level and higher). I tried with src, background, changed background tint, borderWidth, all kinds of things but nothing helped. Even changing size of my drawable doesn't change its size in display. It is small and surrounded by button background. I want it to be bigger and without background.
PS. don't want to do it with ImageView and lose all functionalities that FloatingActionButton offer.
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:src="@drawable/ic_add_circle"
app:borderWidth="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
Try this :
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/faBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/ic_add_circle"
app:fabCustomSize="@dimen/fabSize"
app:fabSize="normal"
app:maxImageSize="@dimen/fabImageSize"
android:background="@null"
android:backgroundTint="@null"
app:backgroundTint="@null"
app:elevation="0dp"
android:elevation="0dp"
/>
For the fab to not cast a shadow you need to have an elevation of 0; didn't find any other way.
Have a nice day.