I wanted to remove the color background of a Material Button and I wanted to show an icon only. The icon shouldn't be tinted with any color but should display the picture(drawable) I am setting. Here is what I want to achieve:
The Button attributes I am using is:
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_google"
app:iconPadding="0dp"
android:padding="0dp"
android:minHeight="48dp"
android:insetTop="0dp"
android:insetBottom="0dp"
app:elevation="3dp"
android:minWidth="48dp"
app:iconGravity="textStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cornerRadius="50dp"
app:icon="@drawable/ic_google_logo"/>
And this is what I am getting:
While I was setting an icon of transparent color of google logo like this(ic_google_logo
):
I have tried to add this style on the button:
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
and it will tint the icon while correcting the background color. like this:
If you have come across this issue before please help. Thank you for your time!