2

I have a MaterialButton defined into the layout

        <com.google.android.material.button.MaterialButton
        android:id="@+id/button"
        style="@style/Widget.MaterialComponents.Button.OutlinedButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:text="@string/close" />

In certain condition, I have to change its style to be a default button : style="@style/Widget.MaterialComponents.Button"

But how to do it programmatically? Strangly, I found nothing to transform a default button to outlined dynamically, and vice versa

Thanks for your help

Turvy
  • 882
  • 1
  • 8
  • 23

0 Answers0