Thursday, 4 March 2021

How to change TextInputLayout or AutoCompleteTextView's ripple color in Java?

Consider the following TextInputLayout with AutoCompleteTextView:

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/input"
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Value"
    android:paddingHorizontal="16dp"
    android:paddingTop="16dp"
    >

    <AutoCompleteTextView
        android:id="@+id/inputEditor"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="none"
        />

</com.google.android.material.textfield.TextInputLayout>

When users click the AutoCompleteTextView, a ripple will expand and fill the AutoCompleteTextView:

enter image description here

How do you change the color of the ripple in Java/Kotlin?



from How to change TextInputLayout or AutoCompleteTextView's ripple color in Java?

No comments:

Post a Comment