What is default background for AppCompatEditText?

Viewed 180

I want to know what is default background of AppCompatEditText because I want to use its as default background of my selector state in xml but now I still not know what is it default backgrounf of this view.

This is what I currently did

private val defaultBackground = background

......

override fun setEnabled(enabled: Boolean) {
    if(enabled) this.background = defaultBackground
    else this.background = null
}
1 Answers

The default style for an AppCompatEditText is Widget.AppCompat.EditText.
Navigating through the styles you can find that the background is defined with:

<item name="android:background">?attr/editTextBackground</item>

Looking for this attribute in the appcompat theme you can find:

<item name="editTextBackground">@drawable/abc_edit_text_material</item>
Related