# TextInputLayout

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/textfield/TextInputLayout.java)

*** ** * ** ***


```
public class TextInputLayout
```

<br />

*** ** * ** ***

Layout which wraps a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText`, android.widget.EditText, or descendant to show a floating label when the hint is hidden while the user inputs text.

Also supports:

- Showing an error via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorEnabled(boolean)` and `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)`, along with showing an error icon via setErrorIconDrawable
- Showing helper text via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextEnabled(boolean)` and `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)`
- Showing placeholder text via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderText(java.lang.CharSequence)`
- Showing prefix text via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)`
- Showing suffix text via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)`
- Showing a character counter via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterEnabled(boolean)` and `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterMaxLength(int)`
- Password visibility toggling via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` API and related attribute. If set, a button is displayed to toggle between the password being displayed as plain-text or disguised, when your EditText is set to display a password.
- Clearing text functionality via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` API and related attribute. If set, a button is displayed when text is present and clicking it clears the EditText field.
- Showing a custom icon specified via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` API and related attribute. You should specify a drawable and content description for the icon. Optionally, you can also specify an android.view.View.OnClickListener, an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` and an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener`.

  **Note:** When using an end icon, the 'end' compound drawable of the EditText will be overridden while the end icon view is visible. To ensure that any existing drawables are restored correctly, you should set those compound drawables relatively (start/end), as opposed to absolutely (left/right).
- Showing a start icon via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(Drawable)` API and related attribute. You should specify a content description for the icon. Optionally, you can also specify an android.view.View.OnClickListener for it.

  **Note:** Use the `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(Drawable)` API in place of setting a start/left compound drawable on the EditText. When using a start icon, the 'start/left' compound drawable of the EditText will be overridden.
- Showing a button that when clicked displays a dropdown menu. The selected option is displayed above the dropdown. You need to use an AutoCompleteTextView instead of a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText` as the input text child, and a Widget.MaterialComponents.TextInputLayout.(...).ExposedDropdownMenu style.

  To disable user input you should set

  ```
  android:editable="false"
  ```
  on the AutoCompleteTextView.

The `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText` class is provided to be used as the input text child of this layout. Using TextInputEditText instead of an EditText provides accessibility support for the text field and allows TextInputLayout greater control over the visual aspects of the text field. This is an example usage:

```
<com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/form_username">

    <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

</com.google.android.material.textfield.TextInputLayout>
```
The hint should be set on the TextInputLayout, rather than the EditText. If a hint is specified on the child EditText in XML, the TextInputLayout might still work correctly; TextInputLayout will use the EditText's hint as its floating label. However, future calls to modify the hint will not update TextInputLayout's hint. To avoid unintended behavior, call `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHint(java.lang.CharSequence)` and `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHint()` on TextInputLayout, instead of on EditText.

If you construct the `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText` child of a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout` programmatically, you should use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout`'s `context` to create the view. This will allow `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout` to pass along the appropriate styling to the `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText`.

If the EditText child is not a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText`, make sure to set the EditText's `android:background` to `null` when using an outlined or filled text field. This allows `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout` to set the EditText's background to an outlined or filled box, respectively.

**Note:** The actual view hierarchy present under TextInputLayout is **NOT** guaranteed to match the view hierarchy as written in XML. As a result, calls to `getParent()` on children of the TextInputLayout -- such as a TextInputEditText -- may not return the TextInputLayout itself, but rather an intermediate View. If you need to access a View directly, set an `android:id` and use findViewById.

For more information, see the [component developer guidance](https://github.com/material-components/material-components-android/blob/master/docs/components/TextField.md) and [design guidelines](https://material.io/components/text-fields/overview).

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate` An `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate` intended to be set on an EditText or `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText` with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setTextInputAccessibilityDelegate(com.google.android.material.textfield.TextInputLayout.AccessibilityDelegate)` to provide attributes for accessibility that are managed by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout`. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.SOURCE) public annotation https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.BoxBackgroundMode` Values for box background mode. |
| `public interface https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.LengthCounter` Interface definition for a length counter. |
| `public interface https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` Callback interface invoked when the view's EditText is attached, or from `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)` if the edit text is already present. |
| `public interface https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener` Callback interface invoked when the view's end icon changes. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED() = 1` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_NONE() = 0` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_OUTLINE() = 2` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_CLEAR_TEXT() = 2` The TextInputLayout will show a clear text button while there is input in the EditText. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_CUSTOM() = -1` The TextInputLayout will show a custom icon specified by the user. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_DROPDOWN_MENU() = 3` The TextInputLayout will show a dropdown button if the EditText is an AutoCompleteTextView and a ` Widget.MaterialComponents.TextInputLayout.(...).ExposedDropdownMenu` style is being used. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_NONE() = 0` Default for the TextInputLayout. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_PASSWORD_TOGGLE() = 1` The TextInputLayout will show a password toggle button if its EditText displays a password. |

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#boxBackgroundColor()` |
| `int` | `@https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.BoxBackgroundMode https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#boxBackgroundMode()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#boxStrokeColor()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#counterMaxLength()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#counterOverflowTextColor()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#counterTextColor()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#cursorColor()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#cursorErrorColor()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#defaultHintTextColor()` |
| `EditText` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#editText()` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#hint()` |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.LengthCounter` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#lengthCounter()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#maxEms()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#maxWidth()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#minEms()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#minWidth()` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#placeholderText()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#placeholderTextAppearance()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#placeholderTextColor()` |
| `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#shapeAppearanceModel()` |
| `Typeface` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#typeface()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#TextInputLayout(Context)(Context context)` |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#TextInputLayout(Context,AttributeSet)(Context context, AttributeSet attrs)` |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#TextInputLayout(Context,AttributeSet,int)(Context context, AttributeSet attrs, int defStyleAttr)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)( https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener listener )` Add a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` that will be invoked when the edit text is attached, or from this method if the EditText is already present. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)( https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener listener )` Add a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener` that will be invoked when the end icon gets changed. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addView(View,int,ViewGroup.LayoutParams)(View child, int index, LayoutParams params)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#clearOnEditTextAttachedListeners()()` Remove all previously added `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener`s. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#clearOnEndIconChangedListeners()()` Remove all previously added `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener`s. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#dispatchProvideAutofillStructure(ViewStructure,int)(ViewStructure structure, int flags)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#draw(Canvas)(Canvas canvas)` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBaseline()()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxBackgroundColor()()` Returns the filled box's default background color. |
| `int` | `@https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.BoxBackgroundMode https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxBackgroundMode()()` Get the box background mode (filled, outline, or none). |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCollapsedPaddingTop()()` Returns the EditText's collapsed top padding |
| `float` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusBottomEnd()()` Returns the box's bottom end corner radius. |
| `float` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusBottomStart()()` Returns the box's bottom start corner radius. |
| `float` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusTopEnd()()` Returns the box's top end corner radius. |
| `float` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusTopStart()()` Returns the box's top start corner radius. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeColor()()` Returns the box's stroke focused color. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeErrorColor()()` Returns the box's stroke color when an error is being displayed. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidth()()` Returns the box's stroke width. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidthFocused()()` Returns the box's stroke focused width. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCounterMaxLength()()` Returns the max length shown at the character counter. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCounterOverflowTextColor()()` Returns the text color used for the overflowed character counter, or null if one has not been set. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCounterTextColor()()` Returns the text color used for the character counter, or null if one has not been set. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCursorColor()()` Returns the cursor color. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCursorErrorColor()()` Returns the cursor error color. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getDefaultHintTextColor()()` Returns the text color used by the hint in both the collapsed and expanded states, or null if no color has been set. |
| `EditText` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEditText()()` Returns the android.widget.EditText used for text input. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconContentDescription()()` Returns the currently configured content description for the end icon. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconDrawable()()` Returns the drawable currently used for the end icon. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMinSize()()` Returns the minimum size of the end icon. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()()` Returns the current end icon mode. |
| `ScaleType` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconScaleType()()` Returns the ScaleType for the end icon's ImageButton. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getError()()` Returns the error message that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)`, or `null` if no error was set or if error displaying is not enabled. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getErrorAccessibilityLiveRegion()()` Returns the accessibility live region of the error message. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getErrorContentDescription()()` Returns the content description of the error message, or null if not set. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getErrorCurrentTextColors()()` Returns the text color used by the error message in current state. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getErrorIconDrawable()()` Returns the drawable currently used for the error icon. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHelperText()()` Returns the helper message that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)`, or `null` if no helper text was set or if helper text functionality is not enabled. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHelperTextCurrentTextColor()()` Returns the text color used by the helper text in the current states. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHint()()` Returns the hint which is displayed in the floating label, if enabled. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHintMaxLines()()` Gets the max number of lines for the hint text. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHintTextColor()()` Gets the collapsed hint text color. |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.LengthCounter` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getLengthCounter()()` Returns the counting method used to count the length of the text. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMaxEms()()` Returns the text field's maximum width in terms of ems, or -1 if no maximum width is set. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMaxWidth()()` Returns the text field's maximum width, or -1 if no maximum width is set. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMinEms()()` Returns the text field's minimum width in terms of ems, or -1 if no minimum width is set. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMinWidth()()` Returns the text field's minimum width, or -1 if no minimum width is set. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `[getPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPasswordVisibilityToggleContentDescription())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconContentDescription()` instead. <br /> |
| `Drawable` | `[getPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPasswordVisibilityToggleDrawable())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconDrawable()` instead. <br /> |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPlaceholderText()()` Returns the placeholder text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderText(java.lang.CharSequence)`, or `null` if there is no placeholder text. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPlaceholderTextAppearance()()` Returns the TextAppearance resource used for the placeholder text color. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPlaceholderTextColor()()` Returns the ColorStateList used for the placeholder text. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPrefixText()()` Returns the prefix text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)`, or `null` if there is no prefix text. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPrefixTextColor()()` Returns the ColorStateList used for the prefix text. |
| `TextView` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPrefixTextView()()` Returns the prefix text view. |
| `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getShapeAppearanceModel()()` Returns the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` of the text field's box background. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconContentDescription()()` Returns the currently configured content description for the start icon. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconDrawable()()` Returns the start icon. |
| `int` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconMinSize()()` Returns the size of the start icon. |
| `ScaleType` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconScaleType()()` Returns the ScaleType for the start icon's ImageButton. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getSuffixText()()` Returns the suffix text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)`, or `null` if there is no suffix text. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getSuffixTextColor()()` Returns the ColorStateList used for the suffix text. |
| `TextView` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getSuffixTextView()()` Returns the suffix text view. |
| `Typeface` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getTypeface()()` Returns the typeface used for the hint and any label views (such as counter and error views). |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isCounterEnabled()()` Returns whether the character counter functionality is enabled or not in this layout. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isEndIconCheckable()()` Returns whether the end icon is checkable. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isEndIconVisible()()` Returns whether the current end icon is visible. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isErrorEnabled()()` Returns whether the error functionality is enabled or not in this layout. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isExpandedHintEnabled()()` Returns whether the hint expands to occupy the input area when the text field is unpopulated and not focused. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isHelperTextEnabled()()` Returns whether the helper text functionality is enabled or not in this layout. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isHintAnimationEnabled()()` Returns whether any hint state changes, due to being focused or non-empty text, are animated. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isHintEnabled()()` Returns whether the floating label functionality is enabled or not in this layout. |
| `boolean` | `[isPasswordVisibilityToggleEnabled](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isPasswordVisibilityToggleEnabled())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isStartIconCheckable()()` Returns whether the start icon is checkable. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isStartIconVisible()()` Returns whether the current start icon is visible. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onGlobalLayout()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onRtlPropertiesChanged(int)(int layoutDirection)` |
| `Parcelable` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onSaveInstanceState()()` |
| `void` | `[passwordVisibilityToggleRequested](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#passwordVisibilityToggleRequested(boolean))(boolean shouldSkipAnimations)` **This method is deprecated.** The password toggle will show as checked or unchecked depending on whether the EditText's android.text.method.TransformationMethod is of type android.text.method.PasswordTransformationMethod <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#refreshEndIconDrawableState()()` This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state). |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#refreshErrorIconDrawableState()()` This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state). |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#refreshStartIconDrawableState()()` This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state). |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#removeOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)( https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener listener )` Remove the given `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` that was previously added via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)`. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#removeOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)( https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener listener )` Remove the given `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener` that was previously added via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)`. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundColor(int)(int boxBackgroundColor)` Sets the filled box's default background color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundColorResource(int)(int boxBackgroundColorId)` Set the resource used for the filled box's background color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundColorStateList(ColorStateList)( ColorStateList boxBackgroundColorStateList )` Sets the box's background color state list. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundMode(int)( @https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.BoxBackgroundMode int boxBackgroundMode )` Set the box background mode (filled, outline, or none). |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCollapsedPaddingTop(int)(int boxCollapsedPaddingTop)` Set the value to use for the EditText's collapsed top padding in box mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerFamily(int)(@https://developer.android.com/reference/com/google/android/material/shape/CornerFamily int cornerFamily)` Sets the box's corner family for all corners of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadii(float,float,float,float)( float boxCornerRadiusTopStart, float boxCornerRadiusTopEnd, float boxCornerRadiusBottomStart, float boxCornerRadiusBottomEnd )` Set the box's corner radii. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadiiResources(int,int,int,int)( int boxCornerRadiusTopStartId, int boxCornerRadiusTopEndId, int boxCornerRadiusBottomEndId, int boxCornerRadiusBottomStartId )` Set the resources used for the box's corner radii. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeColor(int)(int boxStrokeColor)` Set the outline box's stroke focused color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeColorStateList(ColorStateList)(ColorStateList boxStrokeColorStateList)` Set the box's stroke color state list. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeErrorColor(ColorStateList)(ColorStateList strokeErrorColor)` Set the outline box's stroke color when an error is being displayed. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidth(int)(int boxStrokeWidth)` Set the value to use for the box's stroke when in outline box mode, or for the underline stroke in filled mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidthFocused(int)(int boxStrokeWidthFocused)` Set the value to use for the focused box's stroke when in outline box mode, or for the focused underline stroke in filled mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidthFocusedResource(int)(int boxStrokeWidthFocusedResId)` Set the resource dimension to use for the focused box's stroke when in outline box mode, or for the focused underline stroke in filled mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidthResource(int)(int boxStrokeWidthResId)` Set the resource dimension to use for the box's stroke when in outline box mode, or for the underline stroke in filled mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterEnabled(boolean)(boolean enabled)` Whether the character counter functionality is enabled or not in this layout. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterMaxLength(int)(int maxLength)` Sets the max length to display at the character counter. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterOverflowTextAppearance(int)(int counterOverflowTextAppearance)` Sets the text color and size for the overflowed character counter using the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterOverflowTextColor(ColorStateList)(ColorStateList counterOverflowTextColor)` Sets the text color for the overflowed character counter using a ColorStateList. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterTextAppearance(int)(int counterTextAppearance)` Sets the text color and size for the character counter using the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterTextColor(ColorStateList)(ColorStateList counterTextColor)` Sets the text color for the character counter using a ColorStateList. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorColor(ColorStateList)(ColorStateList cursorColor)` Sets the cursor color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorErrorColor(ColorStateList)(ColorStateList cursorErrorColor)` Sets the cursor color when an error is being displayed. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setDefaultHintTextColor(ColorStateList)(ColorStateList textColor)` Sets the text color used by the hint in both the collapsed and expanded states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEnabled(boolean)(boolean enabled)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconActivated(boolean)(boolean endIconActivated)` Sets the current end icon's state to be activated or not. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconCheckable(boolean)(boolean endIconCheckable)` Sets the current end icon to be checkable or not. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence endIconContentDescription)` Set a content description for the end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(int)(int resId)` Set a content description for the end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)(Drawable endIconDrawable)` Set the icon to use for the end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(int)(int resId)` Set the icon to use for the end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMinSize(int)(int iconSize)` Sets the width and height of the end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)(int endIconMode)` Set up the end icon mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconOnClickListener(OnClickListener)(OnClickListener endIconOnClickListener)` Sets the end icon's functionality that is performed when the icon is clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconOnLongClickListener(OnLongClickListener)( OnLongClickListener endIconOnLongClickListener )` Sets the end icon's functionality that is performed when the end icon is long clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconScaleType(ScaleType)(ScaleType scaleType)` Sets ScaleType for the end icon's ImageButton. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)(ColorStateList endIconTintList)` Applies a tint to the end icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintMode(PorterDuff.Mode)(Mode endIconTintMode)` Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` to the end icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconVisible(boolean)(boolean visible)` Sets the current end icon to be VISIBLE or GONE. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence errorText)` Sets an error message that will be displayed below our EditText. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorAccessibilityLiveRegion(int)(int errorAccessibilityLiveRegion)` Sets an accessibility live region for the error message. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorContentDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence errorContentDescription)` Sets a content description for the error message. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorEnabled(boolean)(boolean enabled)` Whether the error functionality is enabled or not in this layout. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconDrawable(Drawable)(Drawable errorIconDrawable)` Set the drawable to use for the error icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconDrawable(int)(int resId)` Set the drawable to use for the error icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconOnClickListener(OnClickListener)(OnClickListener errorIconOnClickListener)` Sets the error icon's functionality that is performed when the icon is clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconOnLongClickListener(OnLongClickListener)( OnLongClickListener errorIconOnLongClickListener )` Sets the error icon's functionality that is performed when the end icon is long clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconTintList(ColorStateList)(ColorStateList errorIconTintList)` Applies a tint to the error icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconTintMode(PorterDuff.Mode)(Mode errorIconTintMode)` Specifies the blending mode used to apply tint to the end icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorTextAppearance(int)(int errorTextAppearance)` Sets the text color and size for the error message from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorTextColor(ColorStateList)(ColorStateList errorTextColor)` Sets the text color used by the error message in all states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setExpandedHintEnabled(boolean)(boolean enabled)` Sets whether the hint should expand to occupy the input area when the text field is unpopulated and not focused. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence helperText)` Sets a helper message that will be displayed below the EditText. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextColor(ColorStateList)(ColorStateList helperTextColor)` Sets the text color used by the helper text in all states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextEnabled(boolean)(boolean enabled)` Whether the helper text functionality is enabled or not in this layout. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextTextAppearance(int)(int helperTextTextAppearance)` Sets the text color and size for the helper text from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHint(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence hint)` Set the hint to be displayed in the floating label, if enabled. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHint(int)(int textHintId)` Set the hint to be displayed in the floating label, if enabled, using the given resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintAnimationEnabled(boolean)(boolean enabled)` Set whether any hint state changes, due to being focused or non-empty text, are animated. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintEnabled(boolean)(boolean enabled)` Sets whether the floating label functionality is enabled or not in this layout. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintMaxLines(int)(int hintMaxLines)` Sets the max number of lines for the hint text. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintTextAppearance(int)(int resId)` Sets the collapsed hint text color, size, style from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintTextColor(ColorStateList)(ColorStateList hintTextColor)` Sets the collapsed hint text color from the specified ColorStateList resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setLengthCounter(com.google.android.material.textfield.TextInputLayout.LengthCounter)(https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.LengthCounter lengthCounter)` Set the counting method used to count the length of a text. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxEms(int)(int maxEms)` Sets the maximum width in terms of ems of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidth(int)(int maxWidth)` Sets the maximum width of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidthResource(int)(int maxWidthId)` Sets the maximum width of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinEms(int)(int minEms)` Sets the minimum width in terms of ems of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidth(int)(int minWidth)` Sets the minimum width of the text field. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidthResource(int)(int minWidthId)` Sets the minimum width of the text field. |
| `void` | `[setPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(java.lang.CharSequence))( https://developer.android.com/reference/java/lang/CharSequence description )` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(int))(int resId)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(int)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(Drawable))(Drawable icon)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(int))(int resId)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(int)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleEnabled](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleEnabled(boolean))(boolean enabled)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleTintList](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleTintList(ColorStateList))(ColorStateList tintList)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` instead. <br /> |
| `void` | `[setPasswordVisibilityToggleTintMode](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleTintMode(PorterDuff.Mode))(Mode mode)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintMode(PorterDuff.Mode)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence placeholderText)` Sets placeholder text that will be displayed in the input area when the hint is collapsed before text is entered. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderTextAppearance(int)(int placeholderTextAppearance)` Sets the text color and size for the placeholder text from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderTextColor(ColorStateList)(ColorStateList placeholderTextColor)` Sets the text color used by the placeholder text in all states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence prefixText)` Sets prefix text that will be displayed in the input area when the hint is collapsed before text is entered. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixTextAppearance(int)(int prefixTextAppearance)` Sets the text color and size for the prefix text from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixTextColor(ColorStateList)(ColorStateList prefixTextColor)` Sets the text color used by the prefix text in all states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)(https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel shapeAppearanceModel)` Sets the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` of the text field's box background. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconCheckable(boolean)(boolean startIconCheckable)` Sets the current start icon to be checkable or not. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconContentDescription(int)(int resId)` Set a content description for the start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconContentDescription(java.lang.CharSequence)( https://developer.android.com/reference/java/lang/CharSequence startIconContentDescription )` Set a content description for the start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(int)(int resId)` Sets the start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(Drawable)(Drawable startIconDrawable)` Sets the start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconMinSize(int)(int iconSize)` Sets the width and height of the start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconOnClickListener(OnClickListener)(OnClickListener startIconOnClickListener)` Sets the start icon's functionality that is performed when the start icon is clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconOnLongClickListener(OnLongClickListener)( OnLongClickListener startIconOnLongClickListener )` Sets the start icon's functionality that is performed when the start icon is long clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconScaleType(ScaleType)(ScaleType scaleType)` Sets ScaleType for the start icon's ImageButton. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconTintList(ColorStateList)(ColorStateList startIconTintList)` Applies a tint to the start icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconTintMode(PorterDuff.Mode)(Mode startIconTintMode)` Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` to the start icon drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconVisible(boolean)(boolean visible)` Sets the start icon to be VISIBLE or GONE. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence suffixText)` Sets suffix text that will be displayed in the input area when the hint is collapsed before text is entered. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixTextAppearance(int)(int suffixTextAppearance)` Sets the text color and size for the suffix text from the specified TextAppearance resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixTextColor(ColorStateList)(ColorStateList suffixTextColor)` Sets the text color used by the suffix text in all states. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setTextInputAccessibilityDelegate(com.google.android.material.textfield.TextInputLayout.AccessibilityDelegate)( https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate delegate )` Sets an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate` providing an accessibility implementation for the EditText used by this layout. |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setTypeface(Typeface)(Typeface typeface)` Set the typeface to use for the hint and any label views (such as counter and error views). |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#dispatchRestoreInstanceState(SparseArray<Parcelable>)(SparseArray<Parcelable> container)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#drawableStateChanged()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onConfigurationChanged(Configuration)(Configuration newConfig)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onLayout(boolean,int,int,int,int)(boolean changed, int left, int top, int right, int bottom)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onMeasure(int,int)(int widthMeasureSpec, int heightMeasureSpec)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#onRestoreInstanceState(Parcelable)(Parcelable state)` |

## Constants

### BOX_BACKGROUND_FILLED

```
public static final int BOX_BACKGROUND_FILLED = 1
```

### BOX_BACKGROUND_NONE

```
public static final int BOX_BACKGROUND_NONE = 0
```

### BOX_BACKGROUND_OUTLINE

```
public static final int BOX_BACKGROUND_OUTLINE = 2
```

### END_ICON_CLEAR_TEXT

```
public static final int END_ICON_CLEAR_TEXT = 2
```

The TextInputLayout will show a clear text button while there is input in the EditText. Clicking it will clear out the text and hide the icon.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` |   |

### END_ICON_CUSTOM

```
public static final int END_ICON_CUSTOM = -1
```

The TextInputLayout will show a custom icon specified by the user.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconOnClickListener(OnClickListener)` | (optionally) |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)` | (optionally) |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)` | (optionally) |

### END_ICON_DROPDOWN_MENU

```
public static final int END_ICON_DROPDOWN_MENU = 3
```

The TextInputLayout will show a dropdown button if the EditText is an AutoCompleteTextView and a `
Widget.MaterialComponents.TextInputLayout.(...).ExposedDropdownMenu` style is being used.

Clicking the button will display a popup with a list of options. The current selected option is displayed on the EditText.

### END_ICON_NONE

```
public static final int END_ICON_NONE = 0
```

Default for the TextInputLayout. It will not display an end icon.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` |   |

### END_ICON_PASSWORD_TOGGLE

```
public static final int END_ICON_PASSWORD_TOGGLE = 1
```

The TextInputLayout will show a password toggle button if its EditText displays a password. When this end icon is clicked, the password is shown as plain-text if it was disguised, or vice-versa.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` |   |

## Public fields

### boxBackgroundColor

```
public int boxBackgroundColor
```

### boxBackgroundMode

```
@TextInputLayout.BoxBackgroundMode
public int boxBackgroundMode
```

### boxStrokeColor

```
public int boxStrokeColor
```

### counterMaxLength

```
public int counterMaxLength
```

### counterOverflowTextColor

```
public ColorStateList counterOverflowTextColor
```

### counterTextColor

```
public ColorStateList counterTextColor
```

### cursorColor

```
public ColorStateList cursorColor
```

### cursorErrorColor

```
public ColorStateList cursorErrorColor
```

### defaultHintTextColor

```
public ColorStateList defaultHintTextColor
```

### editText

```
public EditText editText
```

### hint

```
public CharSequence hint
```

### lengthCounter

```
public TextInputLayout.LengthCounter lengthCounter
```

### maxEms

```
public int maxEms
```

### maxWidth

```
public int maxWidth
```

### minEms

```
public int minEms
```

### minWidth

```
public int minWidth
```

### placeholderText

```
public CharSequence placeholderText
```

### placeholderTextAppearance

```
public int placeholderTextAppearance
```

### placeholderTextColor

```
public ColorStateList placeholderTextColor
```

### shapeAppearanceModel

```
public ShapeAppearanceModel shapeAppearanceModel
```

### typeface

```
public Typeface typeface
```

## Public constructors

### TextInputLayout

```
public TextInputLayout(Context context)
```

### TextInputLayout

```
public TextInputLayout(Context context, AttributeSet attrs)
```

### TextInputLayout

```
public TextInputLayout(Context context, AttributeSet attrs, int defStyleAttr)
```

## Public methods

### addOnEditTextAttachedListener

```
public void addOnEditTextAttachedListener(
    TextInputLayout.OnEditTextAttachedListener listener
)
```

Add a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` that will be invoked when the edit text is attached, or from this method if the EditText is already present.

Components that add a listener should take care to remove it when finished via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#removeOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener listener` | listener to add |

### addOnEndIconChangedListener

```
public void addOnEndIconChangedListener(
    TextInputLayout.OnEndIconChangedListener listener
)
```

Add a `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener` that will be invoked when the end icon gets changed.

Components that add a listener should take care to remove it when finished via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#removeOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener listener` | listener to add |

### addView

```
public void addView(View child, int index, LayoutParams params)
```

### clearOnEditTextAttachedListeners

```
public void clearOnEditTextAttachedListeners()
```

Remove all previously added `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener`s.

### clearOnEndIconChangedListeners

```
public void clearOnEndIconChangedListeners()
```

Remove all previously added `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener`s.

### dispatchProvideAutofillStructure

```
public void dispatchProvideAutofillStructure(ViewStructure structure, int flags)
```

### draw

```
public void draw(Canvas canvas)
```

### getBaseline

```
public int getBaseline()
```

### getBoxBackgroundColor

```
public int getBoxBackgroundColor()
```

Returns the filled box's default background color.

| Returns |
|---|---|
| `int` | the color used for the filled box's background |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundColor(int)` |   |

### getBoxBackgroundMode

```
@TextInputLayout.BoxBackgroundMode
public int getBoxBackgroundMode()
```

Get the box background mode (filled, outline, or none).

May be one of `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_NONE()`, `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED()`, or `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_OUTLINE()`.

### getBoxCollapsedPaddingTop

```
public int getBoxCollapsedPaddingTop()
```

Returns the EditText's collapsed top padding

| Returns |
|---|---|
| `int` | the value used for the box's padding top when collapsed |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCollapsedPaddingTop(int)` |   |

### getBoxCornerRadiusBottomEnd

```
public float getBoxCornerRadiusBottomEnd()
```

Returns the box's bottom end corner radius.

| Returns |
|---|---|
| `float` | the value used for the box's bottom end corner radius |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadii(float,float,float,float)` |   |

### getBoxCornerRadiusBottomStart

```
public float getBoxCornerRadiusBottomStart()
```

Returns the box's bottom start corner radius.

| Returns |
|---|---|
| `float` | the value used for the box's bottom start corner radius |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadii(float,float,float,float)` |   |

### getBoxCornerRadiusTopEnd

```
public float getBoxCornerRadiusTopEnd()
```

Returns the box's top end corner radius.

| Returns |
|---|---|
| `float` | the value used for the box's top end corner radius |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadii(float,float,float,float)` |   |

### getBoxCornerRadiusTopStart

```
public float getBoxCornerRadiusTopStart()
```

Returns the box's top start corner radius.

| Returns |
|---|---|
| `float` | the value used for the box's top start corner radius |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxCornerRadii(float,float,float,float)` |   |

### getBoxStrokeColor

```
public int getBoxStrokeColor()
```

Returns the box's stroke focused color.

| Returns |
|---|---|
| `int` | the color used for the box's stroke when focused |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeColor(int)` |   |

### getBoxStrokeErrorColor

```
public ColorStateList getBoxStrokeErrorColor()
```

Returns the box's stroke color when an error is being displayed.

ref com.google.android.material.R.styleable#TextInputLayout_boxStrokeErrorColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeErrorColor(ColorStateList)` |   |

### getBoxStrokeWidth

```
public int getBoxStrokeWidth()
```

Returns the box's stroke width.

| Returns |
|---|---|
| `int` | the value used for the box's stroke width |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidth(int)` |   |

### getBoxStrokeWidthFocused

```
public int getBoxStrokeWidthFocused()
```

Returns the box's stroke focused width.

| Returns |
|---|---|
| `int` | the value used for the box's stroke width when focused |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidthFocused(int)` |   |

### getCounterMaxLength

```
public int getCounterMaxLength()
```

Returns the max length shown at the character counter.

ref com.google.android.material.R.styleable#TextInputLayout_counterMaxLength

### getCounterOverflowTextColor

```
public ColorStateList getCounterOverflowTextColor()
```

Returns the text color used for the overflowed character counter, or null if one has not been set.

ref com.google.android.material.R.styleable#TextInputLayout_counterOverflowTextColor

| Returns |
|---|---|
| `ColorStateList` | the text color used for the overflowed character counter |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterOverflowTextAppearance(int)` |   |

### getCounterTextColor

```
public ColorStateList getCounterTextColor()
```

Returns the text color used for the character counter, or null if one has not been set.

ref com.google.android.material.R.styleable#TextInputLayout_counterTextColor

| Returns |
|---|---|
| `ColorStateList` | the text color used for the character counter |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterTextColor(ColorStateList)` |   |

### getCursorColor

```
public ColorStateList getCursorColor()
```

Returns the cursor color. It will return the value of `app:cursorColor` if set, or `null` otherwise.

Note: This value only has effect on API levels 28+. On lower API levels `?attr/colorControlActivated` will be used for the cursor color.

ref com.google.android.material.R.styleable#TextInputLayout_cursorColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorColor(ColorStateList)` |   |

### getCursorErrorColor

```
public ColorStateList getCursorErrorColor()
```

Returns the cursor error color.

Note: This value only has effect on API levels 28+. On lower API levels `?attr/colorControlActivated` will be used for the cursor color.

ref com.google.android.material.R.styleable#TextInputLayout_cursorErrorColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorErrorColor(ColorStateList)` |   |

### getDefaultHintTextColor

```
public ColorStateList getDefaultHintTextColor()
```

Returns the text color used by the hint in both the collapsed and expanded states, or null if no color has been set.

### getEditText

```
public EditText getEditText()
```

Returns the android.widget.EditText used for text input.

### getEndIconContentDescription

```
public CharSequence getEndIconContentDescription()
```

Returns the currently configured content description for the end icon.

This will be used to describe the navigation action to users through mechanisms such as screen readers.

### getEndIconDrawable

```
public Drawable getEndIconDrawable()
```

Returns the drawable currently used for the end icon.

ref com.google.android.material.R.styleable#TextInputLayout_endIconDrawable

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)` |   |

### getEndIconMinSize

```
public int getEndIconMinSize()
```

Returns the minimum size of the end icon.

ref android.support.design.button.R.styleable#TextInputLayout_endIconSize

| Returns |
|---|---|
| `int` | Returns the size of the end icon in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMinSize(int)` |   |

### getEndIconMode

```
public int getEndIconMode()
```

Returns the current end icon mode.

ref com.google.android.material.R.styleable#TextInputLayout_endIconMode

| Returns |
|---|---|
| `int` | the end icon mode enum |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` |   |

### getEndIconScaleType

```
public ScaleType getEndIconScaleType()
```

Returns the ScaleType for the end icon's ImageButton.

ref android.support.design.button.R.styleable#TextInputLayout_endIconScaleType

| Returns |
|---|---|
| `ScaleType` | Returns the ScaleType for the end icon's ImageButton. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconScaleType(ScaleType)` |   |

### getError

```
public CharSequence getError()
```

Returns the error message that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)`, or `null` if no error was set or if error displaying is not enabled.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)` |   |

### getErrorAccessibilityLiveRegion

```
public int getErrorAccessibilityLiveRegion()
```

Returns the accessibility live region of the error message.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorAccessibilityLiveRegion(int)` |   |

### getErrorContentDescription

```
public CharSequence getErrorContentDescription()
```

Returns the content description of the error message, or null if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorContentDescription(java.lang.CharSequence)` |   |

### getErrorCurrentTextColors

```
public int getErrorCurrentTextColors()
```

Returns the text color used by the error message in current state.

### getErrorIconDrawable

```
public Drawable getErrorIconDrawable()
```

Returns the drawable currently used for the error icon.

ref com.google.android.material.R.styleable#TextInputLayout_errorIconDrawable

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorIconDrawable(Drawable)` |   |

### getHelperText

```
public CharSequence getHelperText()
```

Returns the helper message that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)`, or `null` if no helper text was set or if helper text functionality is not enabled.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)` |   |

### getHelperTextCurrentTextColor

```
public int getHelperTextCurrentTextColor()
```

Returns the text color used by the helper text in the current states.

### getHint

```
public CharSequence getHint()
```

Returns the hint which is displayed in the floating label, if enabled.

ref com.google.android.material.R.styleable#TextInputLayout_android_hint

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | the hint, or null if there isn't one set, or the hint is not enabled. |

### getHintMaxLines

```
public int getHintMaxLines()
```

Gets the max number of lines for the hint text.

### getHintTextColor

```
public ColorStateList getHintTextColor()
```

Gets the collapsed hint text color.

ref com.google.android.material.R.styleable#TextInputLayout_hintTextColor

### getLengthCounter

```
public TextInputLayout.LengthCounter getLengthCounter()
```

Returns the counting method used to count the length of the text. The default counter will count the number of characters.

### getMaxEms

```
public int getMaxEms()
```

Returns the text field's maximum width in terms of ems, or -1 if no maximum width is set.

ref com.google.android.material.R.styleable#TextInputLayout_android_maxEms

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxEms(int)` |   |

### getMaxWidth

```
public int getMaxWidth()
```

Returns the text field's maximum width, or -1 if no maximum width is set.

ref com.google.android.material.R.styleable#TextInputLayout_android_maxWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidthResource(int)` |   |

### getMinEms

```
public int getMinEms()
```

Returns the text field's minimum width in terms of ems, or -1 if no minimum width is set.

ref com.google.android.material.R.styleable#TextInputLayout_android_minEms

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinEms(int)` |   |

### getMinWidth

```
public int getMinWidth()
```

Returns the text field's minimum width, or -1 if no minimum width is set.

ref com.google.android.material.R.styleable#TextInputLayout_android_minWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidthResource(int)` | (int) |

### getPasswordVisibilityToggleContentDescription

```
public CharSequence [getPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPasswordVisibilityToggleContentDescription())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconContentDescription()` instead.

Returns the currently configured content description for the password visibility toggle button.

This will be used to describe the navigation action to users through mechanisms such as screen readers.

### getPasswordVisibilityToggleDrawable

```
public Drawable [getPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPasswordVisibilityToggleDrawable())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconDrawable()` instead.

Returns the icon currently used for the password visibility toggle button.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleDrawable

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(Drawable)` |   |

### getPlaceholderText

```
public CharSequence getPlaceholderText()
```

Returns the placeholder text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderText(java.lang.CharSequence)`, or `null` if there is no placeholder text.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPlaceholderText(java.lang.CharSequence)` |   |

### getPlaceholderTextAppearance

```
public int getPlaceholderTextAppearance()
```

Returns the TextAppearance resource used for the placeholder text color.

ref com.google.android.material.R.styleable#TextInputLayout_placeholderTextAppearance

### getPlaceholderTextColor

```
public ColorStateList getPlaceholderTextColor()
```

Returns the ColorStateList used for the placeholder text.

ref com.google.android.material.R.styleable#TextInputLayout_placeholderTextColor

### getPrefixText

```
public CharSequence getPrefixText()
```

Returns the prefix text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)`, or `null` if there is no prefix text.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)` |   |

### getPrefixTextColor

```
public ColorStateList getPrefixTextColor()
```

Returns the ColorStateList used for the prefix text.

ref com.google.android.material.R.styleable#TextInputLayout_prefixTextColor

### getPrefixTextView

```
public TextView getPrefixTextView()
```

Returns the prefix text view.

Note: In order for the prefix to work correctly, text should always be set only via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)`, instead of on the TextView directly.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPrefixText(java.lang.CharSequence)` |   |

### getShapeAppearanceModel

```
public ShapeAppearanceModel getShapeAppearanceModel()
```

Returns the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` of the text field's box background.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)` |   |

### getStartIconContentDescription

```
public CharSequence getStartIconContentDescription()
```

Returns the currently configured content description for the start icon.

This will be used to describe the navigation action to users through mechanisms such as screen readers.

### getStartIconDrawable

```
public Drawable getStartIconDrawable()
```

Returns the start icon.

ref com.google.android.material.R.styleable#TextInputLayout_startIconDrawable

| Returns |
|---|---|
| `Drawable` | the drawable used for the start icon |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(Drawable)` |   |

### getStartIconMinSize

```
public int getStartIconMinSize()
```

Returns the size of the start icon.

ref android.support.design.button.R.styleable#TextInputLayout_startIconSize

| Returns |
|---|---|
| `int` | Returns the size of the start icon in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconMinSize(int)` |   |

### getStartIconScaleType

```
public ScaleType getStartIconScaleType()
```

Returns the ScaleType for the start icon's ImageButton.

ref android.support.design.button.R.styleable#TextInputLayout_startIconScaleType

| Returns |
|---|---|
| `ScaleType` | Returns the ScaleType for the start icon's ImageButton. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconScaleType(ScaleType)` |   |

### getSuffixText

```
public CharSequence getSuffixText()
```

Returns the suffix text that was set to be displayed with `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)`, or `null` if there is no suffix text.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)` |   |

### getSuffixTextColor

```
public ColorStateList getSuffixTextColor()
```

Returns the ColorStateList used for the suffix text.

ref com.google.android.material.R.styleable#TextInputLayout_suffixTextColor

### getSuffixTextView

```
public TextView getSuffixTextView()
```

Returns the suffix text view.

Note: In order for the suffix to work correctly, text should always be set only via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)`, instead of on the TextView directly.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setSuffixText(java.lang.CharSequence)` |   |

### getTypeface

```
public Typeface getTypeface()
```

Returns the typeface used for the hint and any label views (such as counter and error views).

### isCounterEnabled

```
public boolean isCounterEnabled()
```

Returns whether the character counter functionality is enabled or not in this layout.

ref com.google.android.material.R.styleable#TextInputLayout_counterEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterEnabled(boolean)` |   |

### isEndIconCheckable

```
public boolean isEndIconCheckable()
```

Returns whether the end icon is checkable.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconCheckable(boolean)` |   |

### isEndIconVisible

```
public boolean isEndIconVisible()
```

Returns whether the current end icon is visible.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconVisible(boolean)` |   |

### isErrorEnabled

```
public boolean isErrorEnabled()
```

Returns whether the error functionality is enabled or not in this layout.

ref com.google.android.material.R.styleable#TextInputLayout_errorEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorEnabled(boolean)` |   |

### isExpandedHintEnabled

```
public boolean isExpandedHintEnabled()
```

Returns whether the hint expands to occupy the input area when the text field is unpopulated and not focused.

ref com.google.android.material.R.styleable#TextInputLayout_hintExpandedEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setExpandedHintEnabled(boolean)` |   |

### isHelperTextEnabled

```
public boolean isHelperTextEnabled()
```

Returns whether the helper text functionality is enabled or not in this layout.

ref com.google.android.material.R.styleable#TextInputLayout_helperTextEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextEnabled(boolean)` |   |

### isHintAnimationEnabled

```
public boolean isHintAnimationEnabled()
```

Returns whether any hint state changes, due to being focused or non-empty text, are animated.

ref com.google.android.material.R.styleable#TextInputLayout_hintAnimationEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintAnimationEnabled(boolean)` |   |

### isHintEnabled

```
public boolean isHintEnabled()
```

Returns whether the floating label functionality is enabled or not in this layout.

ref com.google.android.material.R.styleable#TextInputLayout_hintEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintEnabled(boolean)` |   |

### isPasswordVisibilityToggleEnabled

```
public boolean [isPasswordVisibilityToggleEnabled](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isPasswordVisibilityToggleEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMode()` instead.

Returns whether the password visibility toggle functionality is currently enabled.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleEnabled(boolean)` |   |

### isStartIconCheckable

```
public boolean isStartIconCheckable()
```

Returns whether the start icon is checkable.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconCheckable(boolean)` |   |

### isStartIconVisible

```
public boolean isStartIconVisible()
```

Returns whether the current start icon is visible.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconVisible(boolean)` |   |

### onGlobalLayout

```
public void onGlobalLayout()
```

### onRtlPropertiesChanged

```
public void onRtlPropertiesChanged(int layoutDirection)
```

### onSaveInstanceState

```
public Parcelable onSaveInstanceState()
```

### passwordVisibilityToggleRequested

```
public void [passwordVisibilityToggleRequested](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#passwordVisibilityToggleRequested(boolean))(boolean shouldSkipAnimations)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> The password toggle will show as checked or unchecked depending on whether the EditText's android.text.method.TransformationMethod is of type android.text.method.PasswordTransformationMethod

Handles visibility for a password toggle icon when changing obfuscation in a password edit text. Public so that clients can override this method for custom UI changes when toggling the display of password text

| Parameters |
|---|---|
| `boolean shouldSkipAnimations` | true if the password toggle indicator icon should not animate changes |

### refreshEndIconDrawableState

```
public void refreshEndIconDrawableState()
```

This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state).

### refreshErrorIconDrawableState

```
public void refreshErrorIconDrawableState()
```

This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state).

### refreshStartIconDrawableState

```
public void refreshStartIconDrawableState()
```

This method should be called from within your icon's click listener if your icon's tint list has a color for a state that depends on a click (such as checked state).

### removeOnEditTextAttachedListener

```
public void removeOnEditTextAttachedListener(
    TextInputLayout.OnEditTextAttachedListener listener
)
```

Remove the given `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener` that was previously added via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEditTextAttachedListener(com.google.android.material.textfield.TextInputLayout.OnEditTextAttachedListener)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEditTextAttachedListener listener` | listener to remove |

### removeOnEndIconChangedListener

```
public void removeOnEndIconChangedListener(
    TextInputLayout.OnEndIconChangedListener listener
)
```

Remove the given `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener` that was previously added via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#addOnEndIconChangedListener(com.google.android.material.textfield.TextInputLayout.OnEndIconChangedListener)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.OnEndIconChangedListener listener` | listener to remove |

### setBoxBackgroundColor

```
public void setBoxBackgroundColor(int boxBackgroundColor)
```

Sets the filled box's default background color. Calling this method will make the background color not be stateful, if it was before.

Note: The background color is only supported for filled boxes. When used with box variants other than `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED()`, the box background color may not work as intended.

| Parameters |
|---|---|
| `int boxBackgroundColor` | the color to use for the filled box's background |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxBackgroundColor()` |   |

### setBoxBackgroundColorResource

```
public void setBoxBackgroundColorResource(int boxBackgroundColorId)
```

Set the resource used for the filled box's background color.

Note: The background color is only supported for filled boxes. When used with box variants other than `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED()`, the box background color may not work as intended.

| Parameters |
|---|---|
| `int boxBackgroundColorId` | the resource to use for the box's background color |

### setBoxBackgroundColorStateList

```
public void setBoxBackgroundColorStateList(
    ColorStateList boxBackgroundColorStateList
)
```

Sets the box's background color state list.

Note: The background color is only supported for filled boxes. When used with box variants other than `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED()`, the box background color may not work as intended.

| Parameters |
|---|---|
| `ColorStateList boxBackgroundColorStateList` | the color state list to use for the box's background color |

### setBoxBackgroundMode

```
public void setBoxBackgroundMode(
    @TextInputLayout.BoxBackgroundMode int boxBackgroundMode
)
```

Set the box background mode (filled, outline, or none).

May be one of `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_NONE()`, `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_FILLED()`, or `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#BOX_BACKGROUND_OUTLINE()`.

Note: This method defines TextInputLayout's internal behavior (for example, it allows the hint to be displayed inline with the stroke in a cutout), but doesn't set all attributes that are set in the styles provided for the box background modes. To achieve the look of an outlined or filled text field, supplement this method with other methods that modify the box, such as `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeColor(int)` and `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxBackgroundColor(int)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.BoxBackgroundMode int boxBackgroundMode` | box's background mode |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if boxBackgroundMode is not a @BoxBackgroundMode constant |

### setBoxCollapsedPaddingTop

```
public void setBoxCollapsedPaddingTop(int boxCollapsedPaddingTop)
```

Set the value to use for the EditText's collapsed top padding in box mode.

Customized boxCollapsedPaddingTop will be disabled if the font scale is larger than 1.3.

ref com.google.android.material.R.styleable#TextInputLayout_boxCollapsedPaddingTop

| Parameters |
|---|---|
| `int boxCollapsedPaddingTop` | the value to use for the EditText's collapsed top padding |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCollapsedPaddingTop()` |   |

### setBoxCornerFamily

```
public void setBoxCornerFamily(@CornerFamily int cornerFamily)
```

Sets the box's corner family for all corners of the text field.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/com/google/android/material/shape/CornerFamily int cornerFamily` | the `https://developer.android.com/reference/com/google/android/material/shape/CornerFamily` to be used. May be one of `https://developer.android.com/reference/com/google/android/material/shape/CornerFamily#ROUNDED()` or `https://developer.android.com/reference/com/google/android/material/shape/CornerFamily#CUT()`. |

### setBoxCornerRadii

```
public void setBoxCornerRadii(
    float boxCornerRadiusTopStart,
    float boxCornerRadiusTopEnd,
    float boxCornerRadiusBottomStart,
    float boxCornerRadiusBottomEnd
)
```

Set the box's corner radii.

| Parameters |
|---|---|
| `float boxCornerRadiusTopStart` | the value to use for the box's top start corner radius |
| `float boxCornerRadiusTopEnd` | the value to use for the box's top end corner radius |
| `float boxCornerRadiusBottomStart` | the value to use for the box's bottom start corner radius |
| `float boxCornerRadiusBottomEnd` | the value to use for the box's bottom end corner radius |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusTopStart()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusTopEnd()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusBottomEnd()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxCornerRadiusBottomStart()` |   |

### setBoxCornerRadiiResources

```
public void setBoxCornerRadiiResources(
    int boxCornerRadiusTopStartId,
    int boxCornerRadiusTopEndId,
    int boxCornerRadiusBottomEndId,
    int boxCornerRadiusBottomStartId
)
```

Set the resources used for the box's corner radii.

| Parameters |
|---|---|
| `int boxCornerRadiusTopStartId` | the resource to use for the box's top start corner radius |
| `int boxCornerRadiusTopEndId` | the resource to use for the box's top end corner radius |
| `int boxCornerRadiusBottomEndId` | the resource to use for the box's bottom end corner radius |
| `int boxCornerRadiusBottomStartId` | the resource to use for the box's bottom start corner radius |

### setBoxStrokeColor

```
public void setBoxStrokeColor(int boxStrokeColor)
```

Set the outline box's stroke focused color.

Calling this method when not in outline box mode will do nothing.

| Parameters |
|---|---|
| `int boxStrokeColor` | the color to use for the box's stroke when focused |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeColor()` |   |

### setBoxStrokeColorStateList

```
public void setBoxStrokeColorStateList(ColorStateList boxStrokeColorStateList)
```

Set the box's stroke color state list.

| Parameters |
|---|---|
| `ColorStateList boxStrokeColorStateList` | the color state list to use for the box's stroke |

### setBoxStrokeErrorColor

```
public void setBoxStrokeErrorColor(ColorStateList strokeErrorColor)
```

Set the outline box's stroke color when an error is being displayed.

Calling this method when not in outline box mode will do nothing.

| Parameters |
|---|---|
| `ColorStateList strokeErrorColor` | the error color to use for the box's stroke |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeErrorColor()` |   |

### setBoxStrokeWidth

```
public void setBoxStrokeWidth(int boxStrokeWidth)
```

Set the value to use for the box's stroke when in outline box mode, or for the underline stroke in filled mode.

ref com.google.android.material.R.styleable#TextInputLayout_boxStrokeWidth

| Parameters |
|---|---|
| `int boxStrokeWidth` | the value to use for the box's stroke |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidth()` |   |

### setBoxStrokeWidthFocused

```
public void setBoxStrokeWidthFocused(int boxStrokeWidthFocused)
```

Set the value to use for the focused box's stroke when in outline box mode, or for the focused underline stroke in filled mode.

ref com.google.android.material.R.styleable#TextInputLayout_boxStrokeWidthFocused

| Parameters |
|---|---|
| `int boxStrokeWidthFocused` | the value to use for the box's stroke when focused |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidthFocused()` |   |

### setBoxStrokeWidthFocusedResource

```
public void setBoxStrokeWidthFocusedResource(int boxStrokeWidthFocusedResId)
```

Set the resource dimension to use for the focused box's stroke when in outline box mode, or for the focused underline stroke in filled mode.

ref com.google.android.material.R.styleable#TextInputLayout_boxStrokeWidthFocused

| Parameters |
|---|---|
| `int boxStrokeWidthFocusedResId` | the resource dimension to use for the box's stroke width when focused |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidthFocused(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidthFocused()` |   |

### setBoxStrokeWidthResource

```
public void setBoxStrokeWidthResource(int boxStrokeWidthResId)
```

Set the resource dimension to use for the box's stroke when in outline box mode, or for the underline stroke in filled mode.

ref com.google.android.material.R.styleable#TextInputLayout_boxStrokeWidth

| Parameters |
|---|---|
| `int boxStrokeWidthResId` | the resource dimension to use for the box's stroke width |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setBoxStrokeWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getBoxStrokeWidth()` |   |

### setCounterEnabled

```
public void setCounterEnabled(boolean enabled)
```

Whether the character counter functionality is enabled or not in this layout.

ref com.google.android.material.R.styleable#TextInputLayout_counterEnabled

### setCounterMaxLength

```
public void setCounterMaxLength(int maxLength)
```

Sets the max length to display at the character counter.

ref com.google.android.material.R.styleable#TextInputLayout_counterMaxLength

| Parameters |
|---|---|
| `int maxLength` | maxLength to display. Any value less than or equal to 0 will not be shown. |

### setCounterOverflowTextAppearance

```
public void setCounterOverflowTextAppearance(int counterOverflowTextAppearance)
```

Sets the text color and size for the overflowed character counter using the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_counterOverflowTextAppearance

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterOverflowTextColor(ColorStateList)` |   |

### setCounterOverflowTextColor

```
public void setCounterOverflowTextColor(ColorStateList counterOverflowTextColor)
```

Sets the text color for the overflowed character counter using a ColorStateList.

This text color takes precedence over a text color set in counterOverflowTextAppearance.

ref com.google.android.material.R.styleable#TextInputLayout_counterOverflowTextColor

| Parameters |
|---|---|
| `ColorStateList counterOverflowTextColor` | the text color used for the overflowed character counter |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterOverflowTextAppearance(int)` |   |

### setCounterTextAppearance

```
public void setCounterTextAppearance(int counterTextAppearance)
```

Sets the text color and size for the character counter using the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_counterTextAppearance

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCounterTextColor(ColorStateList)` |   |

### setCounterTextColor

```
public void setCounterTextColor(ColorStateList counterTextColor)
```

Sets the text color for the character counter using a ColorStateList.

This text color takes precedence over a text color set in counterTextAppearance.

ref com.google.android.material.R.styleable#TextInputLayout_counterTextColor

| Parameters |
|---|---|
| `ColorStateList counterTextColor` | text color used for the character counter |

### setCursorColor

```
public void setCursorColor(ColorStateList cursorColor)
```

Sets the cursor color. Using this method will take precedence over using the value of `?attr/colorControlActivated`.

Note: This method only has effect on API levels 28+. On lower API levels `?attr/colorControlActivated` will be used for the cursor color.

ref com.google.android.material.R.styleable#TextInputLayout_cursorColor

| Parameters |
|---|---|
| `ColorStateList cursorColor` | the cursor color to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCursorColor()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorErrorColor(ColorStateList)` |   |

### setCursorErrorColor

```
public void setCursorErrorColor(ColorStateList cursorErrorColor)
```

Sets the cursor color when an error is being displayed. If null, the cursor doesn't change its color when the text field is in an error state.

Note: This method only has effect on API levels 28+. On lower API levels `?attr/colorControlActivated` will be used for the cursor color.

ref com.google.android.material.R.styleable#TextInputLayout_cursorErrorColor

| Parameters |
|---|---|
| `ColorStateList cursorErrorColor` | the error color to use for the cursor |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getCursorErrorColor()` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setCursorColor(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)` |   |

### setDefaultHintTextColor

```
public void setDefaultHintTextColor(ColorStateList textColor)
```

Sets the text color used by the hint in both the collapsed and expanded states.

### setEnabled

```
public void setEnabled(boolean enabled)
```

### setEndIconActivated

```
public void setEndIconActivated(boolean endIconActivated)
```

Sets the current end icon's state to be activated or not.

| Parameters |
|---|---|
| `boolean endIconActivated` | whether the icon should be activated |

### setEndIconCheckable

```
public void setEndIconCheckable(boolean endIconCheckable)
```

Sets the current end icon to be checkable or not.

If the icon works just as a button and the fact that it's checked or not doesn't affect its behavior, such as the clear text end icon, calling this method is encouraged so that screen readers will not announce the icon's checked state.

ref com.google.android.material.R.styleable#TextInputLayout_endIconCheckable

| Parameters |
|---|---|
| `boolean endIconCheckable` | whether the icon should be checkable |

### setEndIconContentDescription

```
public void setEndIconContentDescription(CharSequence endIconContentDescription)
```

Set a content description for the end icon.

The content description will be read via screen readers or other accessibility systems to explain the action of the icon.

ref com.google.android.material.R.styleable#TextInputLayout_endIconContentDescription

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence endIconContentDescription` | Content description to set, or null to clear the content description |

### setEndIconContentDescription

```
public void setEndIconContentDescription(int resId)
```

Set a content description for the end icon.

The content description will be read via screen readers or other accessibility systems to explain the action of the icon.

ref com.google.android.material.R.styleable#TextInputLayout_endIconContentDescription

| Parameters |
|---|---|
| `int resId` | Resource ID of a content description string to set, or 0 to clear the description |

### setEndIconDrawable

```
public void setEndIconDrawable(Drawable endIconDrawable)
```

Set the icon to use for the end icon. This method should be called after specifying an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.EndIconMode` via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)`.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_endIconDrawable

| Parameters |
|---|---|
| `Drawable endIconDrawable` | Drawable to set, may be null to clear the icon |

### setEndIconDrawable

```
public void setEndIconDrawable(int resId)
```

Set the icon to use for the end icon. This method should be called after specifying an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.EndIconMode` via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)`.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_endIconDrawable

| Parameters |
|---|---|
| `int resId` | resource id of the drawable to set, or 0 to clear the icon |

### setEndIconMinSize

```
public void setEndIconMinSize(int iconSize)
```

Sets the width and height of the end icon.

ref android.support.design.button.R.styleable#TextInputLayout_endIconSize

| Parameters |
|---|---|
| `int iconSize` | new dimension for width and height of the end icon in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconMinSize()` |   |

### setEndIconMode

```
public void setEndIconMode(int endIconMode)
```

Set up the end icon mode. When set, a button is placed at the end of the EditText which enables the user to perform the specific icon's functionality.

ref com.google.android.material.R.styleable#TextInputLayout_endIconMode

| Parameters |
|---|---|
| `int endIconMode` | the end icon mode to be set: `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_PASSWORD_TOGGLE()`, `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_CLEAR_TEXT()`, or `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_CUSTOM()`; or `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#END_ICON_NONE()` to clear the current icon if any |

### setEndIconOnClickListener

```
public void setEndIconOnClickListener(OnClickListener endIconOnClickListener)
```

Sets the end icon's functionality that is performed when the icon is clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnClickListener endIconOnClickListener` | the android.view.View.OnClickListener the end icon view will have |

### setEndIconOnLongClickListener

```
public void setEndIconOnLongClickListener(
    OnLongClickListener endIconOnLongClickListener
)
```

Sets the end icon's functionality that is performed when the end icon is long clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnLongClickListener endIconOnLongClickListener` | the android.view.View.OnLongClickListener the end icon view will have, or null to clear it. |

### setEndIconScaleType

```
public void setEndIconScaleType(ScaleType scaleType)
```

Sets ScaleType for the end icon's ImageButton.

ref android.support.design.button.R.styleable#TextInputLayout_endIconScaleType

| Parameters |
|---|---|
| `ScaleType scaleType` | ScaleType for the end icon's ImageButton. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getEndIconScaleType()` |   |

### setEndIconTintList

```
public void setEndIconTintList(ColorStateList endIconTintList)
```

Applies a tint to the end icon drawable. Does not modify the current tint mode, which is SRC_IN by default.

Subsequent calls to `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)` will automatically mutate the drawable and apply the specified tint and tint mode using setTintList.

ref com.google.android.material.R.styleable#TextInputLayout_endIconTint

| Parameters |
|---|---|
| `ColorStateList endIconTintList` | the tint to apply, may be null to clear tint |

### setEndIconTintMode

```
public void setEndIconTintMode(Mode endIconTintMode)
```

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` to the end icon drawable. The default mode is SRC_IN.

ref com.google.android.material.R.styleable#TextInputLayout_endIconTintMode

| Parameters |
|---|---|
| `Mode endIconTintMode` | the blending mode used to apply the tint, may be null to clear tint |

### setEndIconVisible

```
public void setEndIconVisible(boolean visible)
```

Sets the current end icon to be VISIBLE or GONE.

| Parameters |
|---|---|
| `boolean visible` | whether the icon should be set to visible |

### setError

```
public void setError(CharSequence errorText)
```

Sets an error message that will be displayed below our EditText. If the `error` is `null`, the error message will be cleared.

If the error functionality has not been enabled via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setErrorEnabled(boolean)`, then it will be automatically enabled if `error` is not empty.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence errorText` | Error message to display, or null to clear |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getError()` |   |

### setErrorAccessibilityLiveRegion

```
public void setErrorAccessibilityLiveRegion(int errorAccessibilityLiveRegion)
```

Sets an accessibility live region for the error message.

ref com.google.android.material.R.styleable#TextInputLayout_errorAccessibilityLiveRegion

| Parameters |
|---|---|
| `int errorAccessibilityLiveRegion` | Accessibility live region to set |

### setErrorContentDescription

```
public void setErrorContentDescription(CharSequence errorContentDescription)
```

Sets a content description for the error message.

A content description should be set when the error message contains special characters that screen readers or other accessibility systems are not able to read, so that they announce the content description instead.

ref com.google.android.material.R.styleable#TextInputLayout_errorContentDescription

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence errorContentDescription` | Content description to set, or null to clear it |

### setErrorEnabled

```
public void setErrorEnabled(boolean enabled)
```

Whether the error functionality is enabled or not in this layout. Enabling this functionality before setting an error message via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setError(java.lang.CharSequence)`, will mean that this layout will not change size when an error is displayed.

ref com.google.android.material.R.styleable#TextInputLayout_errorEnabled

### setErrorIconDrawable

```
public void setErrorIconDrawable(Drawable errorIconDrawable)
```

Set the drawable to use for the error icon.

ref com.google.android.material.R.styleable#TextInputLayout_errorIconDrawable

| Parameters |
|---|---|
| `Drawable errorIconDrawable` | Drawable to set, may be null to clear the icon |

### setErrorIconDrawable

```
public void setErrorIconDrawable(int resId)
```

Set the drawable to use for the error icon.

ref com.google.android.material.R.styleable#TextInputLayout_errorIconDrawable

| Parameters |
|---|---|
| `int resId` | resource id of the drawable to set, or 0 to clear the icon |

### setErrorIconOnClickListener

```
public void setErrorIconOnClickListener(OnClickListener errorIconOnClickListener)
```

Sets the error icon's functionality that is performed when the icon is clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnClickListener errorIconOnClickListener` | the android.view.View.OnClickListener the error icon view will have |

### setErrorIconOnLongClickListener

```
public void setErrorIconOnLongClickListener(
    OnLongClickListener errorIconOnLongClickListener
)
```

Sets the error icon's functionality that is performed when the end icon is long clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnLongClickListener errorIconOnLongClickListener` | the android.view.View.OnLongClickListener the error icon view will have, or null to clear it. |

### setErrorIconTintList

```
public void setErrorIconTintList(ColorStateList errorIconTintList)
```

Applies a tint to the error icon drawable.

ref com.google.android.material.R.styleable#TextInputLayout_errorIconTint

| Parameters |
|---|---|
| `ColorStateList errorIconTintList` | the tint to apply, may be null to clear tint |

### setErrorIconTintMode

```
public void setErrorIconTintMode(Mode errorIconTintMode)
```

Specifies the blending mode used to apply tint to the end icon drawable. The default mode is SRC_IN.

ref com.google.android.material.R.styleable#TextInputLayout_errorIconTintMode

| Parameters |
|---|---|
| `Mode errorIconTintMode` | the blending mode used to apply the tint, may be null to clear tint |

### setErrorTextAppearance

```
public void setErrorTextAppearance(int errorTextAppearance)
```

Sets the text color and size for the error message from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_errorTextAppearance

### setErrorTextColor

```
public void setErrorTextColor(ColorStateList errorTextColor)
```

Sets the text color used by the error message in all states.

### setExpandedHintEnabled

```
public void setExpandedHintEnabled(boolean enabled)
```

Sets whether the hint should expand to occupy the input area when the text field is unpopulated and not focused.

ref com.google.android.material.R.styleable#TextInputLayout_hintExpandedEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isExpandedHintEnabled()` |   |

### setHelperText

```
public void setHelperText(CharSequence helperText)
```

Sets a helper message that will be displayed below the EditText. If the `helper` is `null`, the helper text functionality will be disabled and the helper message will be hidden.

If the helper text functionality has not been enabled via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperTextEnabled(boolean)`, then it will be automatically enabled if `helper` is not empty.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence helperText` | Helper text to display |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getHelperText()` |   |

### setHelperTextColor

```
public void setHelperTextColor(ColorStateList helperTextColor)
```

Sets the text color used by the helper text in all states.

### setHelperTextEnabled

```
public void setHelperTextEnabled(boolean enabled)
```

Whether the helper text functionality is enabled or not in this layout. Enabling this functionality before setting a helper message via `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHelperText(java.lang.CharSequence)` will mean that this layout will not change size when a helper message is displayed.

ref com.google.android.material.R.styleable#TextInputLayout_helperTextEnabled

### setHelperTextTextAppearance

```
public void setHelperTextTextAppearance(int helperTextTextAppearance)
```

Sets the text color and size for the helper text from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_helperTextTextAppearance

### setHint

```
public void setHint(CharSequence hint)
```

Set the hint to be displayed in the floating label, if enabled.

ref com.google.android.material.R.styleable#TextInputLayout_android_hint

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintEnabled(boolean)` |   |

### setHint

```
public void setHint(int textHintId)
```

Set the hint to be displayed in the floating label, if enabled, using the given resource id.

| Parameters |
|---|---|
| `int textHintId` | The resource id of the text to display in the floating label |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHintEnabled(boolean)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHint(java.lang.CharSequence)` |   |

### setHintAnimationEnabled

```
public void setHintAnimationEnabled(boolean enabled)
```

Set whether any hint state changes, due to being focused or non-empty text, are animated.

ref com.google.android.material.R.styleable#TextInputLayout_hintAnimationEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isHintAnimationEnabled()` |   |

### setHintEnabled

```
public void setHintEnabled(boolean enabled)
```

Sets whether the floating label functionality is enabled or not in this layout.

If enabled, any non-empty hint in the child EditText will be moved into the floating hint, and its existing hint will be cleared. If disabled, then any non-empty floating hint in this layout will be moved into the EditText, and this layout's hint will be cleared.

ref com.google.android.material.R.styleable#TextInputLayout_hintEnabled

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setHint(java.lang.CharSequence)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#isHintEnabled()` |   |

### setHintMaxLines

```
public void setHintMaxLines(int hintMaxLines)
```

Sets the max number of lines for the hint text.

| Parameters |
|---|---|
| `int hintMaxLines` | the number of lines to limit the hint text to |

### setHintTextAppearance

```
public void setHintTextAppearance(int resId)
```

Sets the collapsed hint text color, size, style from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_hintTextAppearance

### setHintTextColor

```
public void setHintTextColor(ColorStateList hintTextColor)
```

Sets the collapsed hint text color from the specified ColorStateList resource.

ref com.google.android.material.R.styleable#TextInputLayout_hintTextColor

### setLengthCounter

```
public void setLengthCounter(TextInputLayout.LengthCounter lengthCounter)
```

Set the counting method used to count the length of a text.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.LengthCounter lengthCounter` | the length counter to use. |

### setMaxEms

```
public void setMaxEms(int maxEms)
```

Sets the maximum width in terms of ems of the text field. The layout will be at most `
maxEms` wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_maxEms

| Parameters |
|---|---|
| `int maxEms` | The maximum width in terms of ems to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMaxEms()` |   |

### setMaxWidth

```
public void setMaxWidth(int maxWidth)
```

Sets the maximum width of the text field. The layout will be at most this dimension wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_maxWidth

| Parameters |
|---|---|
| `int maxWidth` | The maximum width to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidthResource(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMaxWidth()` |   |

### setMaxWidthResource

```
public void setMaxWidthResource(int maxWidthId)
```

Sets the maximum width of the text field. The layout will be at most this dimension wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_maxWidth

| Parameters |
|---|---|
| `int maxWidthId` | The id of the maximum width dimension resource to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMaxWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMaxWidth()` |   |

### setMinEms

```
public void setMinEms(int minEms)
```

Sets the minimum width in terms of ems of the text field. The layout will be at least `
minEms` wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_minEms

| Parameters |
|---|---|
| `int minEms` | The minimum width in terms of ems to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMinEms()` |   |

### setMinWidth

```
public void setMinWidth(int minWidth)
```

Sets the minimum width of the text field. The layout will be at least this dimension wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_minWidth

| Parameters |
|---|---|
| `int minWidth` | The minimum width to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidthResource(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMinWidth()` |   |

### setMinWidthResource

```
public void setMinWidthResource(int minWidthId)
```

Sets the minimum width of the text field. The layout will be at least this dimension wide if its `layout_width` is set to `wrap_content`.

ref com.google.android.material.R.styleable#TextInputLayout_android_minWidth

| Parameters |
|---|---|
| `int minWidthId` | The id of the minimum width dimension resource to be set |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setMinWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getMinWidth()` |   |

### setPasswordVisibilityToggleContentDescription

```
public void [setPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(java.lang.CharSequence))(
    CharSequence description
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(java.lang.CharSequence)` instead.

Set a content description for the navigation button if one is present.

The content description will be read via screen readers or other accessibility systems to explain the action of the password visibility toggle.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleContentDescription

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence description` | Content description to set, or null to clear the content description |

### setPasswordVisibilityToggleContentDescription

```
public void [setPasswordVisibilityToggleContentDescription](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(int))(int resId)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconContentDescription(int)` instead.

Set a content description for the navigation button if one is present.

The content description will be read via screen readers or other accessibility systems to explain the action of the password visibility toggle.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleContentDescription

| Parameters |
|---|---|
| `int resId` | Resource ID of a content description string to set, or 0 to clear the description |

### setPasswordVisibilityToggleDrawable

```
public void [setPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(Drawable))(Drawable icon)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(Drawable)` instead.

Set the icon to use for the password visibility toggle button.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleDrawable

| Parameters |
|---|---|
| `Drawable icon` | Drawable to set, may be null to clear the icon |

### setPasswordVisibilityToggleDrawable

```
public void [setPasswordVisibilityToggleDrawable](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(int))(int resId)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconDrawable(int)` instead.

Set the icon to use for the password visibility toggle button.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleDrawable

| Parameters |
|---|---|
| `int resId` | resource id of the drawable to set, or 0 to clear the icon |

### setPasswordVisibilityToggleEnabled

```
public void [setPasswordVisibilityToggleEnabled](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleEnabled(boolean))(boolean enabled)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconMode(int)` instead.

Enables or disable the password visibility toggle functionality.

When enabled, a button is placed at the end of the EditText which enables the user to switch between the field's input being visibly disguised or not.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleEnabled

| Parameters |
|---|---|
| `boolean enabled` | true to enable the functionality |

### setPasswordVisibilityToggleTintList

```
public void [setPasswordVisibilityToggleTintList](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleTintList(ColorStateList))(ColorStateList tintList)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` instead.

Applies a tint to the password visibility toggle drawable. Does not modify the current tint mode, which is SRC_IN by default.

Subsequent calls to `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleDrawable(Drawable)` will automatically mutate the drawable and apply the specified tint and tint mode using setTintList.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleTint

| Parameters |
|---|---|
| `ColorStateList tintList` | the tint to apply, may be null to clear tint |

### setPasswordVisibilityToggleTintMode

```
public void [setPasswordVisibilityToggleTintMode](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleTintMode(PorterDuff.Mode))(Mode mode)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintMode(PorterDuff.Mode)` instead.

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setPasswordVisibilityToggleTintList(ColorStateList)` to the password visibility toggle drawable. The default mode is SRC_IN.

ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleTintMode

| Parameters |
|---|---|
| `Mode mode` | the blending mode used to apply the tint, may be null to clear tint |

### setPlaceholderText

```
public void setPlaceholderText(CharSequence placeholderText)
```

Sets placeholder text that will be displayed in the input area when the hint is collapsed before text is entered. If the `placeholder` is `null`, any previous placeholder text will be hidden and no placeholder text will be shown.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence placeholderText` | Placeholder text to display |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPlaceholderText()` |   |

### setPlaceholderTextAppearance

```
public void setPlaceholderTextAppearance(int placeholderTextAppearance)
```

Sets the text color and size for the placeholder text from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_placeholderTextAppearance

### setPlaceholderTextColor

```
public void setPlaceholderTextColor(ColorStateList placeholderTextColor)
```

Sets the text color used by the placeholder text in all states.

ref com.google.android.material.R.styleable#TextInputLayout_placeholderTextColor

### setPrefixText

```
public void setPrefixText(CharSequence prefixText)
```

Sets prefix text that will be displayed in the input area when the hint is collapsed before text is entered. If the `prefix` is `null`, any previous prefix text will be hidden and no prefix text will be shown.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence prefixText` | Prefix text to display |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getPrefixText()` |   |

### setPrefixTextAppearance

```
public void setPrefixTextAppearance(int prefixTextAppearance)
```

Sets the text color and size for the prefix text from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_prefixTextAppearance

### setPrefixTextColor

```
public void setPrefixTextColor(ColorStateList prefixTextColor)
```

Sets the text color used by the prefix text in all states.

ref com.google.android.material.R.styleable#TextInputLayout_prefixTextColor

### setShapeAppearanceModel

```
public void setShapeAppearanceModel(ShapeAppearanceModel shapeAppearanceModel)
```

Sets the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` of the text field's box background.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel shapeAppearanceModel` | the desired shape appearance model. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getShapeAppearanceModel()` |   |

### setStartIconCheckable

```
public void setStartIconCheckable(boolean startIconCheckable)
```

Sets the current start icon to be checkable or not.

If the icon works just as a button and the fact that it's checked or not doesn't affect its behavior, such as the clear text end icon, calling this method is encouraged so that screen readers will not announce the icon's checked state.

ref com.google.android.material.R.styleable#TextInputLayout_startIconCheckable

| Parameters |
|---|---|
| `boolean startIconCheckable` | whether the icon should be checkable |

### setStartIconContentDescription

```
public void setStartIconContentDescription(int resId)
```

Set a content description for the start icon.

The content description will be read via screen readers or other accessibility systems to explain the purpose or action of the icon.

ref com.google.android.material.R.styleable#TextInputLayout_startIconContentDescription

| Parameters |
|---|---|
| `int resId` | Resource ID of a content description string to set, or 0 to clear the description |

### setStartIconContentDescription

```
public void setStartIconContentDescription(
    CharSequence startIconContentDescription
)
```

Set a content description for the start icon.

The content description will be read via screen readers or other accessibility systems to explain the purpose or action of the icon.

ref com.google.android.material.R.styleable#TextInputLayout_startIconContentDescription

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence startIconContentDescription` | Content description to set, or null to clear the content description |

### setStartIconDrawable

```
public void setStartIconDrawable(int resId)
```

Sets the start icon.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_startIconDrawable

| Parameters |
|---|---|
| `int resId` | resource id of the drawable to set, or 0 to clear and remove the icon |

### setStartIconDrawable

```
public void setStartIconDrawable(Drawable startIconDrawable)
```

Sets the start icon.

If you use an icon you should also set a description for its action using `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconContentDescription(java.lang.CharSequence)`. This is used for accessibility.

ref com.google.android.material.R.styleable#TextInputLayout_startIconDrawable

| Parameters |
|---|---|
| `Drawable startIconDrawable` | Drawable to set, may be null to clear and remove the icon |

### setStartIconMinSize

```
public void setStartIconMinSize(int iconSize)
```

Sets the width and height of the start icon.

ref android.support.design.button.R.styleable#TextInputLayout_startIconSize

| Parameters |
|---|---|
| `int iconSize` | new dimension for width and height of the start icon in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconMinSize()` |   |

### setStartIconOnClickListener

```
public void setStartIconOnClickListener(OnClickListener startIconOnClickListener)
```

Sets the start icon's functionality that is performed when the start icon is clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnClickListener startIconOnClickListener` | the android.view.View.OnClickListener the start icon view will have, or null to clear it. |

### setStartIconOnLongClickListener

```
public void setStartIconOnLongClickListener(
    OnLongClickListener startIconOnLongClickListener
)
```

Sets the start icon's functionality that is performed when the start icon is long clicked. The icon will not be clickable if its click and long click listeners are null.

| Parameters |
|---|---|
| `OnLongClickListener startIconOnLongClickListener` | the android.view.View.OnLongClickListener the start icon view will have, or null to clear it. |

### setStartIconScaleType

```
public void setStartIconScaleType(ScaleType scaleType)
```

Sets ScaleType for the start icon's ImageButton.

ref android.support.design.button.R.styleable#TextInputLayout_startIconScaleType

| Parameters |
|---|---|
| `ScaleType scaleType` | ScaleType for the start icon's ImageButton. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getStartIconScaleType()` |   |

### setStartIconTintList

```
public void setStartIconTintList(ColorStateList startIconTintList)
```

Applies a tint to the start icon drawable. Does not modify the current tint mode, which is SRC_IN by default.

Subsequent calls to `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setStartIconDrawable(Drawable)` will automatically mutate the drawable and apply the specified tint and tint mode using setTintList.

ref com.google.android.material.R.styleable#TextInputLayout_startIconTint

| Parameters |
|---|---|
| `ColorStateList startIconTintList` | the tint to apply, may be null to clear tint |

### setStartIconTintMode

```
public void setStartIconTintMode(Mode startIconTintMode)
```

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#setEndIconTintList(ColorStateList)` to the start icon drawable. The default mode is SRC_IN.

ref com.google.android.material.R.styleable#TextInputLayout_startIconTintMode

| Parameters |
|---|---|
| `Mode startIconTintMode` | the blending mode used to apply the tint, may be null to clear tint |

### setStartIconVisible

```
public void setStartIconVisible(boolean visible)
```

Sets the start icon to be VISIBLE or GONE.

| Parameters |
|---|---|
| `boolean visible` | whether the icon should be set to visible |

### setSuffixText

```
public void setSuffixText(CharSequence suffixText)
```

Sets suffix text that will be displayed in the input area when the hint is collapsed before text is entered. If the `suffix` is `null`, any previous suffix text will be hidden and no suffix text will be shown.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence suffixText` | Suffix text to display |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout#getSuffixText()` |   |

### setSuffixTextAppearance

```
public void setSuffixTextAppearance(int suffixTextAppearance)
```

Sets the text color and size for the suffix text from the specified TextAppearance resource.

ref com.google.android.material.R.styleable#TextInputLayout_suffixTextAppearance

### setSuffixTextColor

```
public void setSuffixTextColor(ColorStateList suffixTextColor)
```

Sets the text color used by the suffix text in all states.

ref com.google.android.material.R.styleable#TextInputLayout_suffixTextColor

### setTextInputAccessibilityDelegate

```
public void setTextInputAccessibilityDelegate(
    TextInputLayout.AccessibilityDelegate delegate
)
```

Sets an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate` providing an accessibility implementation for the EditText used by this layout.

Note: This method should be used in place of providing an `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout.AccessibilityDelegate` directly on the EditText.

### setTypeface

```
public void setTypeface(Typeface typeface)
```

Set the typeface to use for the hint and any label views (such as counter and error views).

| Parameters |
|---|---|
| `Typeface typeface` | typeface to use, or `null` to use the default. |

## Protected methods

### dispatchRestoreInstanceState

```
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container)
```

### drawableStateChanged

```
protected void drawableStateChanged()
```

### onConfigurationChanged

```
protected void onConfigurationChanged(Configuration newConfig)
```

### onLayout

```
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
```

### onMeasure

```
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
```

### onRestoreInstanceState

```
protected void onRestoreInstanceState(Parcelable state)
```