MaterialAutoCompleteTextView

A special sub-class of android.widget.AutoCompleteTextView that is auto-inflated so that auto-complete text fields (e.g., for an Exposed Dropdown Menu) are accessible when being interacted through a screen reader.

The ListPopupWindow of the android.widget.AutoCompleteTextView is not modal, so it does not grab accessibility focus. The MaterialAutoCompleteTextView changes that by having a modal ListPopupWindow that is displayed instead of the non-modal one, so that the first item of the popup is automatically focused. This simulates the behavior of the .

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
constructor(@NonNull context: Context, @Nullable attributeSet: AttributeSet)
constructor(@NonNull context: Context, @Nullable attributeSet: AttributeSet, defStyleAttr: Int)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun dismissDropDown()
Link copied to clipboard
Returns the color of the popup dropdown container.
Link copied to clipboard
Link copied to clipboard
open fun onWindowFocusChanged(hasWindowFocus: Boolean)
Link copied to clipboard
open fun <T : ListAdapter?, Filterable?> setAdapter(@Nullable adapter: T)
Link copied to clipboard
open fun setDropDownBackgroundTint(@ColorInt dropDownBackgroundColor: Int)
Sets the color of the popup dropdown container.
Link copied to clipboard
open fun setDropDownBackgroundTintList(@Nullable dropDownBackgroundTint: ColorStateList)
Sets the color of the popup dropdown container.
Link copied to clipboard
open fun setRawInputType(type: Int)
Link copied to clipboard
open fun setSimpleItems(@ArrayRes stringArrayResId: Int)
Sets the simple string items of auto-completion with the given string array resource.
open fun setSimpleItems(@NonNull stringArray: Array<String>)
Sets the simple string items of auto-completion with the given string array.
Link copied to clipboard
open fun showDropDown()