TextInputLayout

public class TextInputLayout
extends LinearLayout implements ViewTreeObserver.OnGlobalLayoutListener

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.google.android.material.textfield.TextInputLayout


Layout which wraps a TextInputEditText, EditText, or descendant to show a floating label when the hint is hidden while the user inputs text.

Also supports:

The 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 setHint(CharSequence) and getHint() on TextInputLayout, instead of on EditText.

If you construct the TextInputEditText child of a TextInputLayout programmatically, you should use TextInputLayout's context to create the view. This will allow TextInputLayout to pass along the appropriate styling to the TextInputEditText.

If the EditText child is not a TextInputEditText, make sure to set the EditText's android:background to null when using an outlined or filled text field. This allows 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 View.findViewById(int).

For more information, see the component developer guidance and design guidelines.

Summary

Nested classes

class TextInputLayout.AccessibilityDelegate

An TextInputLayout.AccessibilityDelegate intended to be set on an EditText or TextInputEditText with TextInputLayout.setTextInputAccessibilityDelegate(TextInputLayout.AccessibilityDelegate) to provide attributes for accessibility that are managed by TextInputLayout

@interface TextInputLayout.BoxBackgroundMode

Values for box background mode. 

interface TextInputLayout.LengthCounter

Interface definition for a length counter. 

interface TextInputLayout.OnEditTextAttachedListener

Callback interface invoked when the view's EditText is attached, or from TextInputLayout.addOnEditTextAttachedListener(OnEditTextAttachedListener) if the edit text is already present. 

interface TextInputLayout.OnEndIconChangedListener

Callback interface invoked when the view's end icon changes. 

XML attributes

TextInputLayout_android_hint  
TextInputLayout_android_maxEms  
TextInputLayout_android_maxWidth  
TextInputLayout_android_minEms  
TextInputLayout_android_minWidth  
TextInputLayout_boxCollapsedPaddingTop  
TextInputLayout_boxStrokeErrorColor  
TextInputLayout_boxStrokeWidth  
TextInputLayout_boxStrokeWidthFocused  
TextInputLayout_counterEnabled  
TextInputLayout_counterMaxLength  
TextInputLayout_counterOverflowTextAppearance  
TextInputLayout_counterOverflowTextColor  
TextInputLayout_counterTextAppearance  
TextInputLayout_counterTextColor  
TextInputLayout_cursorColor  
TextInputLayout_cursorErrorColor  
TextInputLayout_endIconCheckable  
TextInputLayout_endIconContentDescription  
TextInputLayout_endIconDrawable  
TextInputLayout_endIconMode  
TextInputLayout_endIconTint  
TextInputLayout_endIconTintMode  
TextInputLayout_errorAccessibilityLiveRegion  
TextInputLayout_errorContentDescription  
TextInputLayout_errorEnabled  
TextInputLayout_errorIconDrawable  
TextInputLayout_errorIconTint  
TextInputLayout_errorIconTintMode  
TextInputLayout_errorTextAppearance  
TextInputLayout_helperTextEnabled  
TextInputLayout_helperTextTextAppearance  
TextInputLayout_hintAnimationEnabled  
TextInputLayout_hintEnabled  
TextInputLayout_hintTextAppearance  
TextInputLayout_hintTextColor  
TextInputLayout_passwordToggleContentDescription  
TextInputLayout_passwordToggleDrawable  
TextInputLayout_passwordToggleEnabled  
TextInputLayout_passwordToggleTint  
TextInputLayout_passwordToggleTintMode  
TextInputLayout_placeholderTextAppearance  
TextInputLayout_placeholderTextColor  
TextInputLayout_prefixTextAppearance  
TextInputLayout_prefixTextColor  
TextInputLayout_startIconCheckable  
TextInputLayout_startIconContentDescription  
TextInputLayout_startIconDrawable  
TextInputLayout_startIconTint  
TextInputLayout_startIconTintMode  
TextInputLayout_suffixTextAppearance  
TextInputLayout_suffixTextColor  

Constants

int BOX_BACKGROUND_FILLED

int BOX_BACKGROUND_NONE

int BOX_BACKGROUND_OUTLINE

int END_ICON_CLEAR_TEXT

The TextInputLayout will show a clear text button while there is input in the EditText.

int END_ICON_CUSTOM

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

int END_ICON_DROPDOWN_MENU

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

int END_ICON_NONE

Default for the TextInputLayout.

int END_ICON_PASSWORD_TOGGLE

The TextInputLayout will show a password toggle button if its EditText displays a password.

Inherited constants

int HORIZONTAL

int SHOW_DIVIDER_BEGINNING

int SHOW_DIVIDER_END

int SHOW_DIVIDER_MIDDLE

int SHOW_DIVIDER_NONE

int VERTICAL

int CLIP_TO_PADDING_MASK

int FOCUS_AFTER_DESCENDANTS

int FOCUS_BEFORE_DESCENDANTS

int FOCUS_BLOCK_DESCENDANTS

int LAYOUT_MODE_CLIP_BOUNDS

int LAYOUT_MODE_OPTICAL_BOUNDS

int PERSISTENT_ALL_CACHES

int PERSISTENT_ANIMATION_CACHE

int PERSISTENT_NO_CACHE

int PERSISTENT_SCROLLING_CACHE

int ACCESSIBILITY_DATA_SENSITIVE_AUTO

int ACCESSIBILITY_DATA_SENSITIVE_NO

int ACCESSIBILITY_DATA_SENSITIVE_YES

int ACCESSIBILITY_LIVE_REGION_ASSERTIVE

int ACCESSIBILITY_LIVE_REGION_NONE

int ACCESSIBILITY_LIVE_REGION_POLITE

int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE

String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY

String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH

String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR

String AUTOFILL_HINT_CREDIT_CARD_NUMBER

String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE

String AUTOFILL_HINT_EMAIL_ADDRESS

String AUTOFILL_HINT_NAME

String AUTOFILL_HINT_PASSWORD

String AUTOFILL_HINT_PHONE

String AUTOFILL_HINT_POSTAL_ADDRESS

String AUTOFILL_HINT_POSTAL_CODE

String AUTOFILL_HINT_USERNAME

int AUTOFILL_TYPE_DATE

int AUTOFILL_TYPE_LIST

int AUTOFILL_TYPE_NONE

int AUTOFILL_TYPE_TEXT

int AUTOFILL_TYPE_TOGGLE

int DRAG_FLAG_ACCESSIBILITY_ACTION

int DRAG_FLAG_GLOBAL

int DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION

int DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION

int DRAG_FLAG_GLOBAL_URI_READ

int DRAG_FLAG_GLOBAL_URI_WRITE

int DRAG_FLAG_OPAQUE

int DRAWING_CACHE_QUALITY_AUTO

int DRAWING_CACHE_QUALITY_HIGH

int DRAWING_CACHE_QUALITY_LOW

int FIND_VIEWS_WITH_CONTENT_DESCRIPTION

int FIND_VIEWS_WITH_TEXT

int FOCUSABLE

int FOCUSABLES_ALL

int FOCUSABLES_TOUCH_MODE

int FOCUSABLE_AUTO

int FOCUS_BACKWARD

int FOCUS_DOWN

int FOCUS_FORWARD

int FOCUS_LEFT

int FOCUS_RIGHT

int FOCUS_UP

int GONE

int HAPTIC_FEEDBACK_ENABLED

int IMPORTANT_FOR_ACCESSIBILITY_AUTO

int IMPORTANT_FOR_ACCESSIBILITY_NO

int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS

int IMPORTANT_FOR_ACCESSIBILITY_YES

int IMPORTANT_FOR_AUTOFILL_AUTO

int IMPORTANT_FOR_AUTOFILL_NO

int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS

int IMPORTANT_FOR_AUTOFILL_YES

int IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS

int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO

int IMPORTANT_FOR_CONTENT_CAPTURE_NO

int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS

int IMPORTANT_FOR_CONTENT_CAPTURE_YES

int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS

int INVISIBLE

int KEEP_SCREEN_ON

int LAYER_TYPE_HARDWARE

int LAYER_TYPE_NONE

int LAYER_TYPE_SOFTWARE

int LAYOUT_DIRECTION_INHERIT

int LAYOUT_DIRECTION_LOCALE

int LAYOUT_DIRECTION_LTR

int LAYOUT_DIRECTION_RTL

int MEASURED_HEIGHT_STATE_SHIFT

int MEASURED_SIZE_MASK

int MEASURED_STATE_MASK

int MEASURED_STATE_TOO_SMALL

int NOT_FOCUSABLE

int NO_ID

int OVER_SCROLL_ALWAYS

int OVER_SCROLL_IF_CONTENT_SCROLLS

int OVER_SCROLL_NEVER

int SCREEN_STATE_OFF

int SCREEN_STATE_ON

int SCROLLBARS_INSIDE_INSET

int SCROLLBARS_INSIDE_OVERLAY

int SCROLLBARS_OUTSIDE_INSET

int SCROLLBARS_OUTSIDE_OVERLAY

int SCROLLBAR_POSITION_DEFAULT

int SCROLLBAR_POSITION_LEFT

int SCROLLBAR_POSITION_RIGHT

int SCROLL_AXIS_HORIZONTAL

int SCROLL_AXIS_NONE

int SCROLL_AXIS_VERTICAL

int SCROLL_CAPTURE_HINT_AUTO

int SCROLL_CAPTURE_HINT_EXCLUDE

int SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS

int SCROLL_CAPTURE_HINT_INCLUDE

int SCROLL_INDICATOR_BOTTOM

int SCROLL_INDICATOR_END

int SCROLL_INDICATOR_LEFT

int SCROLL_INDICATOR_RIGHT

int SCROLL_INDICATOR_START

int SCROLL_INDICATOR_TOP

int SOUND_EFFECTS_ENABLED

int STATUS_BAR_HIDDEN

int STATUS_BAR_VISIBLE

int SYSTEM_UI_FLAG_FULLSCREEN

int SYSTEM_UI_FLAG_HIDE_NAVIGATION

int SYSTEM_UI_FLAG_IMMERSIVE

int SYSTEM_UI_FLAG_IMMERSIVE_STICKY

int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION

int SYSTEM_UI_FLAG_LAYOUT_STABLE

int SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR

int SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

int SYSTEM_UI_FLAG_LOW_PROFILE

int SYSTEM_UI_FLAG_VISIBLE

int SYSTEM_UI_LAYOUT_FLAGS

int TEXT_ALIGNMENT_CENTER

int TEXT_ALIGNMENT_GRAVITY

int TEXT_ALIGNMENT_INHERIT

int TEXT_ALIGNMENT_TEXT_END

int TEXT_ALIGNMENT_TEXT_START

int TEXT_ALIGNMENT_VIEW_END

int TEXT_ALIGNMENT_VIEW_START

int TEXT_DIRECTION_ANY_RTL

int TEXT_DIRECTION_FIRST_STRONG

int TEXT_DIRECTION_FIRST_STRONG_LTR

int TEXT_DIRECTION_FIRST_STRONG_RTL

int TEXT_DIRECTION_INHERIT

int TEXT_DIRECTION_LOCALE

int TEXT_DIRECTION_LTR

int TEXT_DIRECTION_RTL

String VIEW_LOG_TAG

int VISIBLE

Inherited fields

public static final Property<View, Float> ALPHA

protected static final int[] EMPTY_STATE_SET

protected static final int[] ENABLED_FOCUSED_SELECTED_STATE_SET

protected static final int[] ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] ENABLED_FOCUSED_STATE_SET

protected static final int[] ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET

protected static final int[] ENABLED_SELECTED_STATE_SET

protected static final int[] ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] ENABLED_STATE_SET

protected static final int[] ENABLED_WINDOW_FOCUSED_STATE_SET

protected static final int[] FOCUSED_SELECTED_STATE_SET

protected static final int[] FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] FOCUSED_STATE_SET

protected static final int[] FOCUSED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET

protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_ENABLED_FOCUSED_STATE_SET

protected static final int[] PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_ENABLED_SELECTED_STATE_SET

protected static final int[] PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_ENABLED_STATE_SET

protected static final int[] PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_FOCUSED_SELECTED_STATE_SET

protected static final int[] PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_FOCUSED_STATE_SET

protected static final int[] PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_SELECTED_STATE_SET

protected static final int[] PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET

protected static final int[] PRESSED_STATE_SET

protected static final int[] PRESSED_WINDOW_FOCUSED_STATE_SET

public static final Property<View, Float> ROTATION

public static final Property<View, Float> ROTATION_X

public static final Property<View, Float> ROTATION_Y

public static final Property<View, Float> SCALE_X

public static final Property<View, Float> SCALE_Y

protected static final int[] SELECTED_STATE_SET

protected static final int[] SELECTED_WINDOW_FOCUSED_STATE_SET

public static final Property<View, Float> TRANSLATION_X

public static final Property<View, Float> TRANSLATION_Y

public static final Property<View, Float> TRANSLATION_Z

protected static final int[] WINDOW_FOCUSED_STATE_SET

public static final Property<View, Float> X

public static final Property<View, Float> Y

public static final Property<View, Float> Z

Public constructors

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

Public methods

void addOnEditTextAttachedListener(TextInputLayout.OnEditTextAttachedListener listener)

Add a TextInputLayout.OnEditTextAttachedListener that will be invoked when the edit text is attached, or from this method if the EditText is already present.

void addOnEndIconChangedListener(TextInputLayout.OnEndIconChangedListener listener)

Add a TextInputLayout.OnEndIconChangedListener that will be invoked when the end icon gets changed.

void addView(View child, int index, ViewGroup.LayoutParams params)
void clearOnEditTextAttachedListeners()

Remove all previously added TextInputLayout.OnEditTextAttachedListeners.

void clearOnEndIconChangedListeners()

Remove all previously added TextInputLayout.OnEndIconChangedListeners.

void dispatchProvideAutofillStructure(ViewStructure structure, int flags)
void draw(Canvas canvas)
int getBaseline()
int getBoxBackgroundColor()

Returns the filled box's default background color.

int getBoxBackgroundMode()

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

int getBoxCollapsedPaddingTop()

Returns the EditText's collapsed top padding

float getBoxCornerRadiusBottomEnd()

Returns the box's bottom end corner radius.

float getBoxCornerRadiusBottomStart()

Returns the box's bottom start corner radius.

float getBoxCornerRadiusTopEnd()

Returns the box's top end corner radius.

float getBoxCornerRadiusTopStart()

Returns the box's top start corner radius.

int getBoxStrokeColor()

Returns the box's stroke focused color.

ColorStateList getBoxStrokeErrorColor()

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

int getBoxStrokeWidth()

Returns the box's stroke width.

int getBoxStrokeWidthFocused()

Returns the box's stroke focused width.

int getCounterMaxLength()

Returns the max length shown at the character counter.

ColorStateList getCounterOverflowTextColor()

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

ColorStateList getCounterTextColor()

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

ColorStateList getCursorColor()

Returns the cursor color.

ColorStateList getCursorErrorColor()

Returns the cursor error color.

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.

EditText getEditText()

Returns the EditText used for text input.

CharSequence getEndIconContentDescription()

Returns the currently configured content description for the end icon.

Drawable getEndIconDrawable()

Returns the drawable currently used for the end icon.

int getEndIconMinSize()

Returns the minimum size of the end icon.

int getEndIconMode()

Returns the current end icon mode.

ImageView.ScaleType getEndIconScaleType()

Returns the ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

CharSequence getError()

Returns the error message that was set to be displayed with setError(CharSequence), or null if no error was set or if error displaying is not enabled.

int getErrorAccessibilityLiveRegion()

Returns the accessibility live region of the error message.

CharSequence getErrorContentDescription()

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

int getErrorCurrentTextColors()

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

Drawable getErrorIconDrawable()

Returns the drawable currently used for the error icon.

CharSequence getHelperText()

Returns the helper message that was set to be displayed with setHelperText(CharSequence), or null if no helper text was set or if helper text functionality is not enabled.

int getHelperTextCurrentTextColor()

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

CharSequence getHint()

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

ColorStateList getHintTextColor()

Gets the collapsed hint text color.

TextInputLayout.LengthCounter getLengthCounter()

Returns the counting method used to count the length of the text.

int getMaxEms()

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

int getMaxWidth()

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

int getMinEms()

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

int getMinWidth()

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

CharSequence getPasswordVisibilityToggleContentDescription()

This method is deprecated. Use getEndIconContentDescription() instead.

Drawable getPasswordVisibilityToggleDrawable()

This method is deprecated. Use getEndIconDrawable() instead.

CharSequence getPlaceholderText()

Returns the placeholder text that was set to be displayed with setPlaceholderText(CharSequence), or null if there is no placeholder text.

int getPlaceholderTextAppearance()

Returns the TextAppearance resource used for the placeholder text color.

ColorStateList getPlaceholderTextColor()

Returns the ColorStateList used for the placeholder text.

CharSequence getPrefixText()

Returns the prefix text that was set to be displayed with setPrefixText(CharSequence), or null if there is no prefix text.

ColorStateList getPrefixTextColor()

Returns the ColorStateList used for the prefix text.

TextView getPrefixTextView()

Returns the prefix text view.

ShapeAppearanceModel getShapeAppearanceModel()

Returns the ShapeAppearanceModel of the text field's box background.

CharSequence getStartIconContentDescription()

Returns the currently configured content description for the start icon.

Drawable getStartIconDrawable()

Returns the start icon.

int getStartIconMinSize()

Returns the size of the start icon.

ImageView.ScaleType getStartIconScaleType()

Returns the ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

CharSequence getSuffixText()

Returns the suffix text that was set to be displayed with setSuffixText(CharSequence), or null if there is no suffix text.

ColorStateList getSuffixTextColor()

Returns the ColorStateList used for the suffix text.

TextView getSuffixTextView()

Returns the suffix text view.

Typeface getTypeface()

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

boolean isCounterEnabled()

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

boolean isEndIconCheckable()

Returns whether the end icon is checkable.

boolean isEndIconVisible()

Returns whether the current end icon is visible.

boolean isErrorEnabled()

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

boolean isExpandedHintEnabled()

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

boolean isHelperTextEnabled()

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

boolean isHintAnimationEnabled()

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

boolean isHintEnabled()

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

boolean isPasswordVisibilityToggleEnabled()

This method is deprecated. Use getEndIconMode() instead.

boolean isStartIconCheckable()

Returns whether the start icon is checkable.

boolean isStartIconVisible()

Returns whether the current start icon is visible.

void onGlobalLayout()
void onRtlPropertiesChanged(int layoutDirection)
Parcelable onSaveInstanceState()
void passwordVisibilityToggleRequested(boolean shouldSkipAnimations)

This method is deprecated. The password toggle will show as checked or unchecked depending on whether the EditText's TransformationMethod is of type PasswordTransformationMethod

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).

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).

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).

void removeOnEditTextAttachedListener(TextInputLayout.OnEditTextAttachedListener listener)

Remove the given TextInputLayout.OnEditTextAttachedListener that was previously added via addOnEditTextAttachedListener(OnEditTextAttachedListener).

void removeOnEndIconChangedListener(TextInputLayout.OnEndIconChangedListener listener)

Remove the given TextInputLayout.OnEndIconChangedListener that was previously added via addOnEndIconChangedListener(OnEndIconChangedListener).

void setBoxBackgroundColor(int boxBackgroundColor)

Sets the filled box's default background color.

void setBoxBackgroundColorResource(int boxBackgroundColorId)

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

void setBoxBackgroundColorStateList(ColorStateList boxBackgroundColorStateList)

Sets the box's background color state list.

void setBoxBackgroundMode(int boxBackgroundMode)

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

void setBoxCollapsedPaddingTop(int boxCollapsedPaddingTop)

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

void setBoxCornerFamily(int cornerFamily)

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

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

Set the box's corner radii.

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

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

void setBoxStrokeColor(int boxStrokeColor)

Set the outline box's stroke focused color.

void setBoxStrokeColorStateList(ColorStateList boxStrokeColorStateList)

Set the box's stroke color state list.

void setBoxStrokeErrorColor(ColorStateList strokeErrorColor)

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

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.

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.

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.

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.

void setCounterEnabled(boolean enabled)

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

void setCounterMaxLength(int maxLength)

Sets the max length to display at the character counter.

void setCounterOverflowTextAppearance(int counterOverflowTextAppearance)

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

void setCounterOverflowTextColor(ColorStateList counterOverflowTextColor)

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

void setCounterTextAppearance(int counterTextAppearance)

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

void setCounterTextColor(ColorStateList counterTextColor)

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

void setCursorColor(ColorStateList cursorColor)

Sets the cursor color.

void setCursorErrorColor(ColorStateList cursorErrorColor)

Sets the cursor color when an error is being displayed.

void setDefaultHintTextColor(ColorStateList textColor)

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

void setEnabled(boolean enabled)
void setEndIconActivated(boolean endIconActivated)

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

void setEndIconCheckable(boolean endIconCheckable)

Sets the current end icon to be checkable or not.

void setEndIconContentDescription(int resId)

Set a content description for the end icon.

void setEndIconContentDescription(CharSequence endIconContentDescription)

Set a content description for the end icon.

void setEndIconDrawable(Drawable endIconDrawable)

Set the icon to use for the end icon.

void setEndIconDrawable(int resId)

Set the icon to use for the end icon.

void setEndIconMinSize(int iconSize)

Sets the width and height of the end icon.

void setEndIconMode(int endIconMode)

Set up the end icon mode.

void setEndIconOnClickListener(View.OnClickListener endIconOnClickListener)

Sets the end icon's functionality that is performed when the icon is clicked.

void setEndIconOnLongClickListener(View.OnLongClickListener endIconOnLongClickListener)

Sets the end icon's functionality that is performed when the end icon is long clicked.

void setEndIconScaleType(ImageView.ScaleType scaleType)

Sets ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

void setEndIconTintList(ColorStateList endIconTintList)

Applies a tint to the end icon drawable.

void setEndIconTintMode(PorterDuff.Mode endIconTintMode)

Specifies the blending mode used to apply the tint specified by setEndIconTintList(ColorStateList) to the end icon drawable.

void setEndIconVisible(boolean visible)

Sets the current end icon to be VISIBLE or GONE.

void setError(CharSequence errorText)

Sets an error message that will be displayed below our EditText.

void setErrorAccessibilityLiveRegion(int errorAccessibilityLiveRegion)

Sets an accessibility live region for the error message.

void setErrorContentDescription(CharSequence errorContentDescription)

Sets a content description for the error message.

void setErrorEnabled(boolean enabled)

Whether the error functionality is enabled or not in this layout.

void setErrorIconDrawable(int resId)

Set the drawable to use for the error icon.

void setErrorIconDrawable(Drawable errorIconDrawable)

Set the drawable to use for the error icon.

void setErrorIconOnClickListener(View.OnClickListener errorIconOnClickListener)

Sets the error icon's functionality that is performed when the icon is clicked.

void setErrorIconOnLongClickListener(View.OnLongClickListener errorIconOnLongClickListener)

Sets the error icon's functionality that is performed when the end icon is long clicked.

void setErrorIconTintList(ColorStateList errorIconTintList)

Applies a tint to the error icon drawable.

void setErrorIconTintMode(PorterDuff.Mode errorIconTintMode)

Specifies the blending mode used to apply tint to the end icon drawable.

void setErrorTextAppearance(int errorTextAppearance)

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

void setErrorTextColor(ColorStateList errorTextColor)

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

void setExpandedHintEnabled(boolean enabled)

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

void setHelperText(CharSequence helperText)

Sets a helper message that will be displayed below the EditText.

void setHelperTextColor(ColorStateList helperTextColor)

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

void setHelperTextEnabled(boolean enabled)

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

void setHelperTextTextAppearance(int helperTextTextAppearance)

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

void setHint(CharSequence hint)

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

void setHint(int textHintId)

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

void setHintAnimationEnabled(boolean enabled)

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

void setHintEnabled(boolean enabled)

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

void setHintTextAppearance(int resId)

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

void setHintTextColor(ColorStateList hintTextColor)

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

void setLengthCounter(TextInputLayout.LengthCounter lengthCounter)

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

void setMaxEms(int maxEms)

Sets the maximum width in terms of ems of the text field.

void setMaxWidth(int maxWidth)

Sets the maximum width of the text field.

void setMaxWidthResource(int maxWidthId)

Sets the maximum width of the text field.

void setMinEms(int minEms)

Sets the minimum width in terms of ems of the text field.

void setMinWidth(int minWidth)

Sets the minimum width of the text field.

void setMinWidthResource(int minWidthId)

Sets the minimum width of the text field.

void setPasswordVisibilityToggleContentDescription(CharSequence description)

This method is deprecated. Use setEndIconContentDescription(CharSequence) instead.

void setPasswordVisibilityToggleContentDescription(int resId)

This method is deprecated. Use setEndIconContentDescription(int) instead.

void setPasswordVisibilityToggleDrawable(Drawable icon)

This method is deprecated. Use setEndIconDrawable(Drawable) instead.

void setPasswordVisibilityToggleDrawable(int resId)

This method is deprecated. Use setEndIconDrawable(int) instead.

void setPasswordVisibilityToggleEnabled(boolean enabled)

This method is deprecated. Use setEndIconMode(int) instead.

void setPasswordVisibilityToggleTintList(ColorStateList tintList)

This method is deprecated. Use setEndIconTintList(ColorStateList) instead.

void setPasswordVisibilityToggleTintMode(PorterDuff.Mode mode)

This method is deprecated. Use setEndIconTintMode(PorterDuff.Mode) instead.

void setPlaceholderText(CharSequence placeholderText)

Sets placeholder text that will be displayed in the input area when the hint is collapsed before text is entered.

void setPlaceholderTextAppearance(int placeholderTextAppearance)

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

void setPlaceholderTextColor(ColorStateList placeholderTextColor)

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

void setPrefixText(CharSequence prefixText)

Sets prefix text that will be displayed in the input area when the hint is collapsed before text is entered.

void setPrefixTextAppearance(int prefixTextAppearance)

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

void setPrefixTextColor(ColorStateList prefixTextColor)

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

void setShapeAppearanceModel(ShapeAppearanceModel shapeAppearanceModel)

Sets the ShapeAppearanceModel of the text field's box background.

void setStartIconCheckable(boolean startIconCheckable)

Sets the current start icon to be checkable or not.

void setStartIconContentDescription(CharSequence startIconContentDescription)

Set a content description for the start icon.

void setStartIconContentDescription(int resId)

Set a content description for the start icon.

void setStartIconDrawable(Drawable startIconDrawable)

Sets the start icon.

void setStartIconDrawable(int resId)

Sets the start icon.

void setStartIconMinSize(int iconSize)

Sets the width and height of the start icon.

void setStartIconOnClickListener(View.OnClickListener startIconOnClickListener)

Sets the start icon's functionality that is performed when the start icon is clicked.

void setStartIconOnLongClickListener(View.OnLongClickListener startIconOnLongClickListener)

Sets the start icon's functionality that is performed when the start icon is long clicked.

void setStartIconScaleType(ImageView.ScaleType scaleType)

Sets ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

void setStartIconTintList(ColorStateList startIconTintList)

Applies a tint to the start icon drawable.

void setStartIconTintMode(PorterDuff.Mode startIconTintMode)

Specifies the blending mode used to apply the tint specified by setEndIconTintList(ColorStateList) to the start icon drawable.

void setStartIconVisible(boolean visible)

Sets the start icon to be VISIBLE or GONE.

void setSuffixText(CharSequence suffixText)

Sets suffix text that will be displayed in the input area when the hint is collapsed before text is entered.

void setSuffixTextAppearance(int suffixTextAppearance)

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

void setSuffixTextColor(ColorStateList suffixTextColor)

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

void setTextInputAccessibilityDelegate(TextInputLayout.AccessibilityDelegate delegate)

Sets an TextInputLayout.AccessibilityDelegate providing an accessibility implementation for the EditText used by this layout.

void setTypeface(Typeface typeface)

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

Protected methods

void dispatchRestoreInstanceState(SparseArray<Parcelable> container)
void drawableStateChanged()
void onConfigurationChanged(Configuration newConfig)
void onLayout(boolean changed, int left, int top, int right, int bottom)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void onRestoreInstanceState(Parcelable state)

Inherited methods

boolean checkLayoutParams(ViewGroup.LayoutParams arg0)
ViewGroup.LayoutParams generateDefaultLayoutParams()
ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams arg0)
ViewGroup.LayoutParams generateLayoutParams(AttributeSet arg0)
CharSequence getAccessibilityClassName()
int getBaseline()
int getBaselineAlignedChildIndex()
Drawable getDividerDrawable()
int getDividerPadding()
int getGravity()
int getOrientation()
int getShowDividers()
float getWeightSum()
boolean isBaselineAligned()
boolean isMeasureWithLargestChildEnabled()
void onDraw(Canvas arg0)
void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4)
void onMeasure(int arg0, int arg1)
void onRtlPropertiesChanged(int arg0)
void setBaselineAligned(boolean arg0)
void setBaselineAlignedChildIndex(int arg0)
void setDividerDrawable(Drawable arg0)
void setDividerPadding(int arg0)
void setGravity(int arg0)
void setHorizontalGravity(int arg0)
void setMeasureWithLargestChildEnabled(boolean arg0)
void setOrientation(int arg0)
void setShowDividers(int arg0)
void setVerticalGravity(int arg0)
void setWeightSum(float arg0)
boolean shouldDelayChildPressedState()
void addChildrenForAccessibility(ArrayList<View> arg0)
void addExtraDataToAccessibilityNodeInfo(AccessibilityNodeInfo arg0, String arg1, Bundle arg2)
void addFocusables(ArrayList<View> arg0, int arg1, int arg2)
void addKeyboardNavigationClusters(Collection<View> arg0, int arg1)
boolean addStatesFromChildren()
void addTouchables(ArrayList<View> arg0)
void addView(View arg0, ViewGroup.LayoutParams arg1)
void addView(View arg0, int arg1)
void addView(View arg0, int arg1, ViewGroup.LayoutParams arg2)
void addView(View arg0)
void addView(View arg0, int arg1, int arg2)
boolean addViewInLayout(View arg0, int arg1, ViewGroup.LayoutParams arg2, boolean arg3)
boolean addViewInLayout(View arg0, int arg1, ViewGroup.LayoutParams arg2)
void attachLayoutAnimationParameters(View arg0, ViewGroup.LayoutParams arg1, int arg2, int arg3)
void attachViewToParent(View arg0, int arg1, ViewGroup.LayoutParams arg2)
void bringChildToFront(View arg0)
boolean canAnimate()
boolean checkLayoutParams(ViewGroup.LayoutParams arg0)
void childDrawableStateChanged(View arg0)
void childHasTransientStateChanged(View arg0, boolean arg1)
void cleanupLayoutState(View arg0)
void clearChildFocus(View arg0)
void clearDisappearingChildren()
void clearFocus()
void debug(int arg0)
void detachAllViewsFromParent()
void detachViewFromParent(int arg0)
void detachViewFromParent(View arg0)
void detachViewsFromParent(int arg0, int arg1)
WindowInsets dispatchApplyWindowInsets(WindowInsets arg0)
boolean dispatchCapturedPointerEvent(MotionEvent arg0)
void dispatchConfigurationChanged(Configuration arg0)
void dispatchCreateViewTranslationRequest(Map<AutofillId, long[]> arg0, int[] arg1, TranslationCapability arg2, List<ViewTranslationRequest> arg3)
void dispatchDisplayHint(int arg0)
boolean dispatchDragEvent(DragEvent arg0)
void dispatchDraw(Canvas arg0)
void dispatchDrawableHotspotChanged(float arg0, float arg1)
void dispatchFinishTemporaryDetach()
void dispatchFreezeSelfOnly(SparseArray<Parcelable> arg0)
boolean dispatchGenericFocusedEvent(MotionEvent arg0)
boolean dispatchGenericPointerEvent(MotionEvent arg0)
boolean dispatchHoverEvent(MotionEvent arg0)
boolean dispatchKeyEvent(KeyEvent arg0)
boolean dispatchKeyEventPreIme(KeyEvent arg0)
boolean dispatchKeyShortcutEvent(KeyEvent arg0)
void dispatchPointerCaptureChanged(boolean arg0)
void dispatchProvideAutofillStructure(ViewStructure arg0, int arg1)
void dispatchProvideStructure(ViewStructure arg0)
void dispatchRestoreInstanceState(SparseArray<Parcelable> arg0)
void dispatchSaveInstanceState(SparseArray<Parcelable> arg0)
void dispatchScrollCaptureSearch(Rect arg0, Point arg1, Consumer<ScrollCaptureTarget> arg2)
void dispatchSetActivated(boolean arg0)
void dispatchSetPressed(boolean arg0)
void dispatchSetSelected(boolean arg0)
void dispatchStartTemporaryDetach()
void dispatchSystemUiVisibilityChanged(int arg0)
void dispatchThawSelfOnly(SparseArray<Parcelable> arg0)
boolean dispatchTouchEvent(MotionEvent arg0)
boolean dispatchTrackballEvent(MotionEvent arg0)
boolean dispatchUnhandledMove(View arg0, int arg1)
void dispatchVisibilityChanged(View arg0, int arg1)
void dispatchWindowFocusChanged(boolean arg0)
void dispatchWindowInsetsAnimationEnd(WindowInsetsAnimation arg0)
void dispatchWindowInsetsAnimationPrepare(WindowInsetsAnimation arg0)
WindowInsets dispatchWindowInsetsAnimationProgress(WindowInsets arg0, List<WindowInsetsAnimation> arg1)
WindowInsetsAnimation.Bounds dispatchWindowInsetsAnimationStart(WindowInsetsAnimation arg0, WindowInsetsAnimation.Bounds arg1)
void dispatchWindowSystemUiVisiblityChanged(int arg0)
void dispatchWindowVisibilityChanged(int arg0)
boolean drawChild(Canvas arg0, View arg1, long arg2)
void drawableStateChanged()
void endViewTransition(View arg0)
View findFocus()
OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(View arg0, View arg1)
void findViewsWithText(ArrayList<View> arg0, CharSequence arg1, int arg2)
View focusSearch(View arg0, int arg1)
void focusableViewAvailable(View arg0)
boolean gatherTransparentRegion(Region arg0)
ViewGroup.LayoutParams generateDefaultLayoutParams()
ViewGroup.LayoutParams generateLayoutParams(AttributeSet arg0)
ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams arg0)
CharSequence getAccessibilityClassName()
View getChildAt(int arg0)
int getChildCount()
int getChildDrawingOrder(int arg0, int arg1)
final int getChildDrawingOrder(int arg0)
static int getChildMeasureSpec(int arg0, int arg1, int arg2)
boolean getChildStaticTransformation(View arg0, Transformation arg1)
boolean getChildVisibleRect(View arg0, Rect arg1, Point arg2)
boolean getClipChildren()
boolean getClipToPadding()
int getDescendantFocusability()
View getFocusedChild()
LayoutAnimationController getLayoutAnimation()
Animation.AnimationListener getLayoutAnimationListener()
int getLayoutMode()
LayoutTransition getLayoutTransition()
int getNestedScrollAxes()
ViewOverlay getOverlay()
int getPersistentDrawingCache()
boolean getTouchscreenBlocksFocus()
boolean hasFocus()
boolean hasTransientState()
int indexOfChild(View arg0)
final void invalidateChild(View arg0, Rect arg1)
ViewParent invalidateChildInParent(int[] arg0, Rect arg1)
boolean isAlwaysDrawnWithCacheEnabled()
boolean isAnimationCacheEnabled()
boolean isChildrenDrawingOrderEnabled()
boolean isChildrenDrawnWithCacheEnabled()
boolean isLayoutSuppressed()
boolean isMotionEventSplittingEnabled()
boolean isTransitionGroup()
void jumpDrawablesToCurrentState()
final void layout(int arg0, int arg1, int arg2, int arg3)
void measureChild(View arg0, int arg1, int arg2)
void measureChildWithMargins(View arg0, int arg1, int arg2, int arg3, int arg4)
void measureChildren(int arg0, int arg1)
void notifySubtreeAccessibilityStateChanged(View arg0, View arg1, int arg2)
final void offsetDescendantRectToMyCoords(View arg0, Rect arg1)
final void offsetRectIntoDescendantCoords(View arg0, Rect arg1)
void onAttachedToWindow()
int[] onCreateDrawableState(int arg0)
void onDescendantInvalidated(View arg0, View arg1)
void onDetachedFromWindow()
boolean onInterceptHoverEvent(MotionEvent arg0)
boolean onInterceptTouchEvent(MotionEvent arg0)
abstract void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4)
boolean onNestedFling(View arg0, float arg1, float arg2, boolean arg3)
boolean onNestedPreFling(View arg0, float arg1, float arg2)
boolean onNestedPrePerformAccessibilityAction(View arg0, int arg1, Bundle arg2)
void onNestedPreScroll(View arg0, int arg1, int arg2, int[] arg3)
void onNestedScroll(View arg0, int arg1, int arg2, int arg3, int arg4)
void onNestedScrollAccepted(View arg0, View arg1, int arg2)
boolean onRequestFocusInDescendants(int arg0, Rect arg1)
boolean onRequestSendAccessibilityEvent(View arg0, AccessibilityEvent arg1)
PointerIcon onResolvePointerIcon(MotionEvent arg0, int arg1)
boolean onStartNestedScroll(View arg0, View arg1, int arg2)
void onStopNestedScroll(View arg0)
void onViewAdded(View arg0)
void onViewRemoved(View arg0)
void recomputeViewAttributes(View arg0)
void removeAllViews()
void removeAllViewsInLayout()
void removeDetachedView(View arg0, boolean arg1)
void removeView(View arg0)
void removeViewAt(int arg0)
void removeViewInLayout(View arg0)
void removeViews(int arg0, int arg1)
void removeViewsInLayout(int arg0, int arg1)
void requestChildFocus(View arg0, View arg1)
boolean requestChildRectangleOnScreen(View arg0, Rect arg1, boolean arg2)
void requestDisallowInterceptTouchEvent(boolean arg0)
boolean requestFocus(int arg0, Rect arg1)
boolean requestSendAccessibilityEvent(View arg0, AccessibilityEvent arg1)
void requestTransparentRegion(View arg0)
boolean restoreDefaultFocus()
void scheduleLayoutAnimation()
void setAddStatesFromChildren(boolean arg0)
void setAlwaysDrawnWithCacheEnabled(boolean arg0)
void setAnimationCacheEnabled(boolean arg0)
void setChildrenDrawingCacheEnabled(boolean arg0)
void setChildrenDrawingOrderEnabled(boolean arg0)
void setChildrenDrawnWithCacheEnabled(boolean arg0)
void setClipChildren(boolean arg0)
void setClipToPadding(boolean arg0)
void setDescendantFocusability(int arg0)
void setLayoutAnimation(LayoutAnimationController arg0)
void setLayoutAnimationListener(Animation.AnimationListener arg0)
void setLayoutMode(int arg0)
void setLayoutTransition(LayoutTransition arg0)
void setMotionEventSplittingEnabled(boolean arg0)
void setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener arg0)
void setPersistentDrawingCache(int arg0)
void setStaticTransformationsEnabled(boolean arg0)
void setTouchscreenBlocksFocus(boolean arg0)
void setTransitionGroup(boolean arg0)
void setWindowInsetsAnimationCallback(WindowInsetsAnimation.Callback arg0)
boolean shouldDelayChildPressedState()
boolean showContextMenuForChild(View arg0, float arg1, float arg2)
boolean showContextMenuForChild(View arg0)
ActionMode startActionModeForChild(View arg0, ActionMode.Callback arg1, int arg2)
ActionMode startActionModeForChild(View arg0, ActionMode.Callback arg1)
void startLayoutAnimation()
void startViewTransition(View arg0)
void suppressLayout(boolean arg0)
void updateViewLayout(View arg0, ViewGroup.LayoutParams arg1)
void addChildrenForAccessibility(ArrayList<View> arg0)
void addExtraDataToAccessibilityNodeInfo(AccessibilityNodeInfo arg0, String arg1, Bundle arg2)
void addFocusables(ArrayList<View> arg0, int arg1)
void addFocusables(ArrayList<View> arg0, int arg1, int arg2)
void addKeyboardNavigationClusters(Collection<View> arg0, int arg1)
void addOnAttachStateChangeListener(View.OnAttachStateChangeListener arg0)
void addOnLayoutChangeListener(View.OnLayoutChangeListener arg0)
void addOnUnhandledKeyEventListener(View.OnUnhandledKeyEventListener arg0)
void addTouchables(ArrayList<View> arg0)
ViewPropertyAnimator animate()
void announceForAccessibility(CharSequence arg0)
void autofill(AutofillValue arg0)
void autofill(SparseArray<AutofillValue> arg0)
boolean awakenScrollBars(int arg0, boolean arg1)
boolean awakenScrollBars(int arg0)
boolean awakenScrollBars()
void bringToFront()
void buildDrawingCache(boolean arg0)
void buildDrawingCache()
void buildLayer()
boolean callOnClick()
boolean canResolveLayoutDirection()
boolean canResolveTextAlignment()
boolean canResolveTextDirection()
boolean canScrollHorizontally(int arg0)
boolean canScrollVertically(int arg0)
final void cancelDragAndDrop()
void cancelLongPress()
final void cancelPendingInputEvents()
boolean checkInputConnectionProxy(View arg0)
void clearAnimation()
void clearFocus()
void clearViewTranslationCallback()
static int combineMeasuredStates(int arg0, int arg1)
int computeHorizontalScrollExtent()
int computeHorizontalScrollOffset()
int computeHorizontalScrollRange()
void computeScroll()
WindowInsets computeSystemWindowInsets(WindowInsets arg0, Rect arg1)
int computeVerticalScrollExtent()
int computeVerticalScrollOffset()
int computeVerticalScrollRange()
AccessibilityNodeInfo createAccessibilityNodeInfo()
void createContextMenu(ContextMenu arg0)
void destroyDrawingCache()
WindowInsets dispatchApplyWindowInsets(WindowInsets arg0)
boolean dispatchCapturedPointerEvent(MotionEvent arg0)
void dispatchConfigurationChanged(Configuration arg0)
void dispatchCreateViewTranslationRequest(Map<AutofillId, long[]> arg0, int[] arg1, TranslationCapability arg2, List<ViewTranslationRequest> arg3)
void dispatchDisplayHint(int arg0)
boolean dispatchDragEvent(DragEvent arg0)
void dispatchDraw(Canvas arg0)
void dispatchDrawableHotspotChanged(float arg0, float arg1)
void dispatchFinishTemporaryDetach()
boolean dispatchGenericFocusedEvent(MotionEvent arg0)
boolean dispatchGenericMotionEvent(MotionEvent arg0)
boolean dispatchGenericPointerEvent(MotionEvent arg0)
boolean dispatchHoverEvent(MotionEvent arg0)
boolean dispatchKeyEvent(KeyEvent arg0)
boolean dispatchKeyEventPreIme(KeyEvent arg0)
boolean dispatchKeyShortcutEvent(KeyEvent arg0)
boolean dispatchNestedFling(float arg0, float arg1, boolean arg2)
boolean dispatchNestedPreFling(float arg0, float arg1)
boolean dispatchNestedPrePerformAccessibilityAction(int arg0, Bundle arg1)
boolean dispatchNestedPreScroll(int arg0, int arg1, int[] arg2, int[] arg3)
boolean dispatchNestedScroll(int arg0, int arg1, int arg2, int arg3, int[] arg4)
void dispatchPointerCaptureChanged(boolean arg0)
boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent arg0)
void dispatchProvideAutofillStructure(ViewStructure arg0, int arg1)
void dispatchProvideStructure(ViewStructure arg0)
void dispatchRestoreInstanceState(SparseArray<Parcelable> arg0)
void dispatchSaveInstanceState(SparseArray<Parcelable> arg0)
void dispatchScrollCaptureSearch(Rect arg0, Point arg1, Consumer<ScrollCaptureTarget> arg2)
void dispatchSetActivated(boolean arg0)
void dispatchSetPressed(boolean arg0)
void dispatchSetSelected(boolean arg0)
void dispatchStartTemporaryDetach()
void dispatchSystemUiVisibilityChanged(int arg0)
boolean dispatchTouchEvent(MotionEvent arg0)
boolean dispatchTrackballEvent(MotionEvent arg0)
boolean dispatchUnhandledMove(View arg0, int arg1)
void dispatchVisibilityChanged(View arg0, int arg1)
void dispatchWindowFocusChanged(boolean arg0)
void dispatchWindowInsetsAnimationEnd(WindowInsetsAnimation arg0)
void dispatchWindowInsetsAnimationPrepare(WindowInsetsAnimation arg0)
WindowInsets dispatchWindowInsetsAnimationProgress(WindowInsets arg0, List<WindowInsetsAnimation> arg1)
WindowInsetsAnimation.Bounds dispatchWindowInsetsAnimationStart(WindowInsetsAnimation arg0, WindowInsetsAnimation.Bounds arg1)
void dispatchWindowSystemUiVisiblityChanged(int arg0)
void dispatchWindowVisibilityChanged(int arg0)
void draw(Canvas arg0)
void drawableHotspotChanged(float arg0, float arg1)
void drawableStateChanged()
View findFocus()
final OnBackInvokedDispatcher findOnBackInvokedDispatcher()
final <T extends View> T findViewById(int arg0)
final <T extends View> T findViewWithTag(Object arg0)
void findViewsWithText(ArrayList<View> arg0, CharSequence arg1, int arg2)
boolean fitSystemWindows(Rect arg0)
View focusSearch(int arg0)
void forceHasOverlappingRendering(boolean arg0)
void forceLayout()
boolean gatherTransparentRegion(Region arg0)
void generateDisplayHash(String arg0, Rect arg1, Executor arg2, DisplayHashResultCallback arg3)
static int generateViewId()
CharSequence getAccessibilityClassName()
View.AccessibilityDelegate getAccessibilityDelegate()
int getAccessibilityLiveRegion()
AccessibilityNodeProvider getAccessibilityNodeProvider()
CharSequence getAccessibilityPaneTitle()
int getAccessibilityTraversalAfter()
int getAccessibilityTraversalBefore()
String getAllowedHandwritingDelegatePackageName()
String getAllowedHandwritingDelegatorPackageName()
float getAlpha()
Animation getAnimation()
Matrix getAnimationMatrix()
IBinder getApplicationWindowToken()
int[] getAttributeResolutionStack(int arg0)
Map<Integer, Integer> getAttributeSourceResourceMap()
String[] getAutofillHints()
final AutofillId getAutofillId()
int getAutofillType()
AutofillValue getAutofillValue()
Drawable getBackground()
BlendMode getBackgroundTintBlendMode()
ColorStateList getBackgroundTintList()
PorterDuff.Mode getBackgroundTintMode()
int getBaseline()
final int getBottom()
float getBottomFadingEdgeStrength()
int getBottomPaddingOffset()
float getCameraDistance()
boolean getClipBounds(Rect arg0)
Rect getClipBounds()
final boolean getClipToOutline()
final ContentCaptureSession getContentCaptureSession()
CharSequence getContentDescription()
final Context getContext()
ContextMenu.ContextMenuInfo getContextMenuInfo()
final boolean getDefaultFocusHighlightEnabled()
static int getDefaultSize(int arg0, int arg1)
Display getDisplay()
final int[] getDrawableState()
Bitmap getDrawingCache()
Bitmap getDrawingCache(boolean arg0)
int getDrawingCacheBackgroundColor()
int getDrawingCacheQuality()
void getDrawingRect(Rect arg0)
long getDrawingTime()
float getElevation()
int getExplicitStyle()
boolean getFilterTouchesWhenObscured()
boolean getFitsSystemWindows()
int getFocusable()
ArrayList<View> getFocusables(int arg0)
void getFocusedRect(Rect arg0)
Drawable getForeground()
int getForegroundGravity()
BlendMode getForegroundTintBlendMode()
ColorStateList getForegroundTintList()
PorterDuff.Mode getForegroundTintMode()
final boolean getGlobalVisibleRect(Rect arg0)
boolean getGlobalVisibleRect(Rect arg0, Point arg1)
Handler getHandler()
float getHandwritingBoundsOffsetBottom()
float getHandwritingBoundsOffsetLeft()
float getHandwritingBoundsOffsetRight()
float getHandwritingBoundsOffsetTop()
Runnable getHandwritingDelegatorCallback()
final boolean getHasOverlappingRendering()
final int getHeight()
void getHitRect(Rect arg0)
int getHorizontalFadingEdgeLength()
int getHorizontalScrollbarHeight()
Drawable getHorizontalScrollbarThumbDrawable()
Drawable getHorizontalScrollbarTrackDrawable()
int getId()
int getImportantForAccessibility()
int getImportantForAutofill()
int getImportantForContentCapture()
boolean getKeepScreenOn()
KeyEvent.DispatcherState getKeyDispatcherState()
int getLabelFor()
int getLayerType()
int getLayoutDirection()
ViewGroup.LayoutParams getLayoutParams()
final int getLeft()
float getLeftFadingEdgeStrength()
int getLeftPaddingOffset()
final boolean getLocalVisibleRect(Rect arg0)
void getLocationInSurface(int[] arg0)
void getLocationInWindow(int[] arg0)
void getLocationOnScreen(int[] arg0)
Matrix getMatrix()
final int getMeasuredHeight()
final int getMeasuredHeightAndState()
final int getMeasuredState()
final int getMeasuredWidth()
final int getMeasuredWidthAndState()
int getMinimumHeight()
int getMinimumWidth()
int getNextClusterForwardId()
int getNextFocusDownId()
int getNextFocusForwardId()
int getNextFocusLeftId()
int getNextFocusRightId()
int getNextFocusUpId()
View.OnFocusChangeListener getOnFocusChangeListener()
int getOutlineAmbientShadowColor()
ViewOutlineProvider getOutlineProvider()
int getOutlineSpotShadowColor()
int getOverScrollMode()
ViewOverlay getOverlay()
int getPaddingBottom()
int getPaddingEnd()
int getPaddingLeft()
int getPaddingRight()
int getPaddingStart()
int getPaddingTop()
final ViewParent getParent()
ViewParent getParentForAccessibility()
float getPivotX()
float getPivotY()
PointerIcon getPointerIcon()
final List<Rect> getPreferKeepClearRects()
String[] getReceiveContentMimeTypes()
Resources getResources()
final boolean getRevealOnFocusHint()
final int getRight()
float getRightFadingEdgeStrength()
int getRightPaddingOffset()
AttachedSurfaceControl getRootSurfaceControl()
View getRootView()
WindowInsets getRootWindowInsets()
float getRotation()
float getRotationX()
float getRotationY()
float getScaleX()
float getScaleY()
int getScrollBarDefaultDelayBeforeFade()
int getScrollBarFadeDuration()
int getScrollBarSize()
int getScrollBarStyle()
int getScrollCaptureHint()
int getScrollIndicators()
final int getScrollX()
final int getScrollY()
int getSolidColor()
int getSourceLayoutResId()
final CharSequence getStateDescription()
StateListAnimator getStateListAnimator()
int getSuggestedMinimumHeight()
int getSuggestedMinimumWidth()
List<Rect> getSystemGestureExclusionRects()
int getSystemUiVisibility()
Object getTag()
Object getTag(int arg0)
int getTextAlignment()
int getTextDirection()
CharSequence getTooltipText()
final int getTop()
float getTopFadingEdgeStrength()
int getTopPaddingOffset()
TouchDelegate getTouchDelegate()
ArrayList<View> getTouchables()
float getTransitionAlpha()
String getTransitionName()
float getTranslationX()
float getTranslationY()
float getTranslationZ()
long getUniqueDrawingId()
int getVerticalFadingEdgeLength()
int getVerticalScrollbarPosition()
Drawable getVerticalScrollbarThumbDrawable()
Drawable getVerticalScrollbarTrackDrawable()
int getVerticalScrollbarWidth()
ViewTranslationResponse getViewTranslationResponse()
ViewTreeObserver getViewTreeObserver()
int getVisibility()
final int getWidth()
int getWindowAttachCount()
WindowId getWindowId()
WindowInsetsController getWindowInsetsController()
int getWindowSystemUiVisibility()
IBinder getWindowToken()
int getWindowVisibility()
void getWindowVisibleDisplayFrame(Rect arg0)
float getX()
float getY()
float getZ()
boolean hasExplicitFocusable()
boolean hasFocus()
boolean hasFocusable()
boolean hasNestedScrollingParent()
boolean hasOnClickListeners()
boolean hasOnLongClickListeners()
boolean hasOverlappingRendering()
boolean hasPointerCapture()
boolean hasTransientState()
boolean hasWindowFocus()
static View inflate(Context arg0, int arg1, ViewGroup arg2)
void invalidate()
void invalidate(Rect arg0)
void invalidate(int arg0, int arg1, int arg2, int arg3)
void invalidateDrawable(Drawable arg0)
void invalidateOutline()
boolean isAccessibilityDataSensitive()
boolean isAccessibilityFocused()
boolean isAccessibilityHeading()
boolean isActivated()
boolean isAttachedToWindow()
boolean isAutoHandwritingEnabled()
boolean isClickable()
boolean isContextClickable()
boolean isCredential()
boolean isDirty()
boolean isDrawingCacheEnabled()
boolean isDuplicateParentStateEnabled()
boolean isEnabled()
final boolean isFocusable()
final boolean isFocusableInTouchMode()
boolean isFocused()
final boolean isFocusedByDefault()
boolean isForceDarkAllowed()
boolean isHandwritingDelegate()
boolean isHapticFeedbackEnabled()
boolean isHardwareAccelerated()
boolean isHorizontalFadingEdgeEnabled()
boolean isHorizontalScrollBarEnabled()
boolean isHovered()
boolean isImportantForAccessibility()
final boolean isImportantForAutofill()
final boolean isImportantForContentCapture()
boolean isInEditMode()
boolean isInLayout()
boolean isInTouchMode()
final boolean isKeyboardNavigationCluster()
boolean isLaidOut()
boolean isLayoutDirectionResolved()
boolean isLayoutRequested()
boolean isLongClickable()
boolean isNestedScrollingEnabled()
boolean isOpaque()
boolean isPaddingOffsetRequired()
boolean isPaddingRelative()
boolean isPivotSet()
final boolean isPreferKeepClear()
boolean isPressed()
boolean isSaveEnabled()
boolean isSaveFromParentEnabled()
boolean isScreenReaderFocusable()
boolean isScrollContainer()
boolean isScrollbarFadingEnabled()
boolean isSelected()
final boolean isShowingLayoutBounds()
boolean isShown()
boolean isSoundEffectsEnabled()
final boolean isTemporarilyDetached()
boolean isTextAlignmentResolved()
boolean isTextDirectionResolved()
boolean isVerticalFadingEdgeEnabled()
boolean isVerticalScrollBarEnabled()
boolean isVisibleToUserForAutofill(int arg0)
void jumpDrawablesToCurrentState()
View keyboardNavigationClusterSearch(View arg0, int arg1)
void layout(int arg0, int arg1, int arg2, int arg3)
final void measure(int arg0, int arg1)
static int[] mergeDrawableStates(int[] arg0, int[] arg1)
void offsetLeftAndRight(int arg0)
void offsetTopAndBottom(int arg0)
void onAnimationEnd()
void onAnimationStart()
WindowInsets onApplyWindowInsets(WindowInsets arg0)
void onAttachedToWindow()
void onCancelPendingInputEvents()
boolean onCapturedPointerEvent(MotionEvent arg0)
boolean onCheckIsTextEditor()
void onConfigurationChanged(Configuration arg0)
void onCreateContextMenu(ContextMenu arg0)
int[] onCreateDrawableState(int arg0)
InputConnection onCreateInputConnection(EditorInfo arg0)
void onCreateViewTranslationRequest(int[] arg0, Consumer<ViewTranslationRequest> arg1)
void onCreateVirtualViewTranslationRequests(long[] arg0, int[] arg1, Consumer<ViewTranslationRequest> arg2)
void onDetachedFromWindow()
void onDisplayHint(int arg0)
boolean onDragEvent(DragEvent arg0)
void onDraw(Canvas arg0)
void onDrawForeground(Canvas arg0)
final void onDrawScrollBars(Canvas arg0)
boolean onFilterTouchEventForSecurity(MotionEvent arg0)
void onFinishInflate()
void onFinishTemporaryDetach()
void onFocusChanged(boolean arg0, int arg1, Rect arg2)
boolean onGenericMotionEvent(MotionEvent arg0)
void onHoverChanged(boolean arg0)
boolean onHoverEvent(MotionEvent arg0)
void onInitializeAccessibilityEvent(AccessibilityEvent arg0)
void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo arg0)
boolean onKeyDown(int arg0, KeyEvent arg1)
boolean onKeyLongPress(int arg0, KeyEvent arg1)
boolean onKeyMultiple(int arg0, int arg1, KeyEvent arg2)
boolean onKeyPreIme(int arg0, KeyEvent arg1)
boolean onKeyShortcut(int arg0, KeyEvent arg1)
boolean onKeyUp(int arg0, KeyEvent arg1)
void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4)
void onMeasure(int arg0, int arg1)
void onOverScrolled(int arg0, int arg1, boolean arg2, boolean arg3)
void onPointerCaptureChange(boolean arg0)
void onPopulateAccessibilityEvent(AccessibilityEvent arg0)
void onProvideAutofillStructure(ViewStructure arg0, int arg1)
void onProvideAutofillVirtualStructure(ViewStructure arg0, int arg1)
void onProvideContentCaptureStructure(ViewStructure arg0, int arg1)
void onProvideStructure(ViewStructure arg0)
void onProvideVirtualStructure(ViewStructure arg0)
ContentInfo onReceiveContent(ContentInfo arg0)
PointerIcon onResolvePointerIcon(MotionEvent arg0, int arg1)
void onRestoreInstanceState(Parcelable arg0)
void onRtlPropertiesChanged(int arg0)
Parcelable onSaveInstanceState()
void onScreenStateChanged(int arg0)
void onScrollCaptureSearch(Rect arg0, Point arg1, Consumer<ScrollCaptureTarget> arg2)
void onScrollChanged(int arg0, int arg1, int arg2, int arg3)
boolean onSetAlpha(int arg0)
void onSizeChanged(int arg0, int arg1, int arg2, int arg3)
void onStartTemporaryDetach()
boolean onTouchEvent(MotionEvent arg0)
boolean onTrackballEvent(MotionEvent arg0)
void onViewTranslationResponse(ViewTranslationResponse arg0)
void onVirtualViewTranslationResponses(LongSparseArray<ViewTranslationResponse> arg0)
void onVisibilityAggregated(boolean arg0)
void onVisibilityChanged(View arg0, int arg1)
void onWindowFocusChanged(boolean arg0)
void onWindowSystemUiVisibilityChanged(int arg0)
void onWindowVisibilityChanged(int arg0)
boolean overScrollBy(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, boolean arg8)
boolean performAccessibilityAction(int arg0, Bundle arg1)
boolean performClick()
boolean performContextClick(float arg0, float arg1)
boolean performContextClick()
boolean performHapticFeedback(int arg0)
boolean performHapticFeedback(int arg0, int arg1)
boolean performLongClick(float arg0, float arg1)
boolean performLongClick()
ContentInfo performReceiveContent(ContentInfo arg0)
void playSoundEffect(int arg0)
boolean post(Runnable arg0)
boolean postDelayed(Runnable arg0, long arg1)
void postInvalidate()
void postInvalidate(int arg0, int arg1, int arg2, int arg3)
void postInvalidateDelayed(long arg0, int arg1, int arg2, int arg3, int arg4)
void postInvalidateDelayed(long arg0)
void postInvalidateOnAnimation(int arg0, int arg1, int arg2, int arg3)
void postInvalidateOnAnimation()
void postOnAnimation(Runnable arg0)
void postOnAnimationDelayed(Runnable arg0, long arg1)
void refreshDrawableState()
void releasePointerCapture()
boolean removeCallbacks(Runnable arg0)
void removeOnAttachStateChangeListener(View.OnAttachStateChangeListener arg0)
void removeOnLayoutChangeListener(View.OnLayoutChangeListener arg0)
void removeOnUnhandledKeyEventListener(View.OnUnhandledKeyEventListener arg0)
void requestApplyInsets()
void requestFitSystemWindows()
final boolean requestFocus(int arg0)
final boolean requestFocus()
boolean requestFocus(int arg0, Rect arg1)
final boolean requestFocusFromTouch()
void requestLayout()
void requestPointerCapture()
boolean requestRectangleOnScreen(Rect arg0)
boolean requestRectangleOnScreen(Rect arg0, boolean arg1)
final void requestUnbufferedDispatch(int arg0)
final void requestUnbufferedDispatch(MotionEvent arg0)
final <T extends View> T requireViewById(int arg0)
void resetPivot()
static int resolveSize(int arg0, int arg1)
static int resolveSizeAndState(int arg0, int arg1, int arg2)
boolean restoreDefaultFocus()
void restoreHierarchyState(SparseArray<Parcelable> arg0)
final void saveAttributeDataForStyleable(Context arg0, int[] arg1, AttributeSet arg2, TypedArray arg3, int arg4, int arg5)
void saveHierarchyState(SparseArray<Parcelable> arg0)
void scheduleDrawable(Drawable arg0, Runnable arg1, long arg2)
void scrollBy(int arg0, int arg1)
void scrollTo(int arg0, int arg1)
void sendAccessibilityEvent(int arg0)
void sendAccessibilityEventUnchecked(AccessibilityEvent arg0)
void setAccessibilityDataSensitive(int arg0)
void setAccessibilityDelegate(View.AccessibilityDelegate arg0)
void setAccessibilityHeading(boolean arg0)
void setAccessibilityLiveRegion(int arg0)
void setAccessibilityPaneTitle(CharSequence arg0)
void setAccessibilityTraversalAfter(int arg0)
void setAccessibilityTraversalBefore(int arg0)
void setActivated(boolean arg0)
void setAllowClickWhenDisabled(boolean arg0)
void setAllowedHandwritingDelegatePackage(String arg0)
void setAllowedHandwritingDelegatorPackage(String arg0)
void setAlpha(float arg0)
void setAnimation(Animation arg0)
void setAnimationMatrix(Matrix arg0)
void setAutoHandwritingEnabled(boolean arg0)
void setAutofillHints(String... arg0)
void setAutofillId(AutofillId arg0)
void setBackground(Drawable arg0)
void setBackgroundColor(int arg0)
void setBackgroundDrawable(Drawable arg0)
void setBackgroundResource(int arg0)
void setBackgroundTintBlendMode(BlendMode arg0)
void setBackgroundTintList(ColorStateList arg0)
void setBackgroundTintMode(PorterDuff.Mode arg0)
final void setBottom(int arg0)
void setCameraDistance(float arg0)
void setClickable(boolean arg0)
void setClipBounds(Rect arg0)
void setClipToOutline(boolean arg0)
void setContentCaptureSession(ContentCaptureSession arg0)
void setContentDescription(CharSequence arg0)
void setContextClickable(boolean arg0)
void setDefaultFocusHighlightEnabled(boolean arg0)
void setDrawingCacheBackgroundColor(int arg0)
void setDrawingCacheEnabled(boolean arg0)
void setDrawingCacheQuality(int arg0)
void setDuplicateParentStateEnabled(boolean arg0)
void setElevation(float arg0)
void setEnabled(boolean arg0)
void setFadingEdgeLength(int arg0)
void setFilterTouchesWhenObscured(boolean arg0)
void setFitsSystemWindows(boolean arg0)
void setFocusable(boolean arg0)
void setFocusable(int arg0)
void setFocusableInTouchMode(boolean arg0)
void setFocusedByDefault(boolean arg0)
void setForceDarkAllowed(boolean arg0)
void setForeground(Drawable arg0)
void setForegroundGravity(int arg0)
void setForegroundTintBlendMode(BlendMode arg0)
void setForegroundTintList(ColorStateList arg0)
void setForegroundTintMode(PorterDuff.Mode arg0)
void setHandwritingBoundsOffsets(float arg0, float arg1, float arg2, float arg3)
void setHandwritingDelegatorCallback(Runnable arg0)
void setHapticFeedbackEnabled(boolean arg0)
void setHasTransientState(boolean arg0)
void setHorizontalFadingEdgeEnabled(boolean arg0)
void setHorizontalScrollBarEnabled(boolean arg0)
void setHorizontalScrollbarThumbDrawable(Drawable arg0)
void setHorizontalScrollbarTrackDrawable(Drawable arg0)
void setHovered(boolean arg0)
void setId(int arg0)
void setImportantForAccessibility(int arg0)
void setImportantForAutofill(int arg0)
void setImportantForContentCapture(int arg0)
void setIsCredential(boolean arg0)
void setIsHandwritingDelegate(boolean arg0)
void setKeepScreenOn(boolean arg0)
void setKeyboardNavigationCluster(boolean arg0)
void setLabelFor(int arg0)
void setLayerPaint(Paint arg0)
void setLayerType(int arg0, Paint arg1)
void setLayoutDirection(int arg0)
void setLayoutParams(ViewGroup.LayoutParams arg0)
final void setLeft(int arg0)
final void setLeftTopRightBottom(int arg0, int arg1, int arg2, int arg3)
void setLongClickable(boolean arg0)
final void setMeasuredDimension(int arg0, int arg1)
void setMinimumHeight(int arg0)
void setMinimumWidth(int arg0)
void setNestedScrollingEnabled(boolean arg0)
void setNextClusterForwardId(int arg0)
void setNextFocusDownId(int arg0)
void setNextFocusForwardId(int arg0)
void setNextFocusLeftId(int arg0)
void setNextFocusRightId(int arg0)
void setNextFocusUpId(int arg0)
void setOnApplyWindowInsetsListener(View.OnApplyWindowInsetsListener arg0)
void setOnCapturedPointerListener(View.OnCapturedPointerListener arg0)
void setOnClickListener(View.OnClickListener arg0)
void setOnContextClickListener(View.OnContextClickListener arg0)
void setOnCreateContextMenuListener(View.OnCreateContextMenuListener arg0)
void setOnDragListener(View.OnDragListener arg0)
void setOnFocusChangeListener(View.OnFocusChangeListener arg0)
void setOnGenericMotionListener(View.OnGenericMotionListener arg0)
void setOnHoverListener(View.OnHoverListener arg0)
void setOnKeyListener(View.OnKeyListener arg0)
void setOnLongClickListener(View.OnLongClickListener arg0)
void setOnReceiveContentListener(String[] arg0, OnReceiveContentListener arg1)
void setOnScrollChangeListener(View.OnScrollChangeListener arg0)
void setOnSystemUiVisibilityChangeListener(View.OnSystemUiVisibilityChangeListener arg0)
void setOnTouchListener(View.OnTouchListener arg0)
void setOutlineAmbientShadowColor(int arg0)
void setOutlineProvider(ViewOutlineProvider arg0)
void setOutlineSpotShadowColor(int arg0)
void setOverScrollMode(int arg0)
void setPadding(int arg0, int arg1, int arg2, int arg3)
void setPaddingRelative(int arg0, int arg1, int arg2, int arg3)
void setPivotX(float arg0)
void setPivotY(float arg0)
void setPointerIcon(PointerIcon arg0)
final void setPreferKeepClear(boolean arg0)
final void setPreferKeepClearRects(List<Rect> arg0)
void setPressed(boolean arg0)
void setRenderEffect(RenderEffect arg0)
final void setRevealOnFocusHint(boolean arg0)
final void setRight(int arg0)
void setRotation(float arg0)
void setRotationX(float arg0)
void setRotationY(float arg0)
void setSaveEnabled(boolean arg0)
void setSaveFromParentEnabled(boolean arg0)
void setScaleX(float arg0)
void setScaleY(float arg0)
void setScreenReaderFocusable(boolean arg0)
void setScrollBarDefaultDelayBeforeFade(int arg0)
void setScrollBarFadeDuration(int arg0)
void setScrollBarSize(int arg0)
void setScrollBarStyle(int arg0)
final void setScrollCaptureCallback(ScrollCaptureCallback arg0)
void setScrollCaptureHint(int arg0)
void setScrollContainer(boolean arg0)
void setScrollIndicators(int arg0, int arg1)
void setScrollIndicators(int arg0)
void setScrollX(int arg0)
void setScrollY(int arg0)
void setScrollbarFadingEnabled(boolean arg0)
void setSelected(boolean arg0)
void setSoundEffectsEnabled(boolean arg0)
void setStateDescription(CharSequence arg0)
void setStateListAnimator(StateListAnimator arg0)
void setSystemGestureExclusionRects(List<Rect> arg0)
void setSystemUiVisibility(int arg0)
void setTag(int arg0, Object arg1)
void setTag(Object arg0)
void setTextAlignment(int arg0)
void setTextDirection(int arg0)
void setTooltipText(CharSequence arg0)
final void setTop(int arg0)
void setTouchDelegate(TouchDelegate arg0)
void setTransitionAlpha(float arg0)
final void setTransitionName(String arg0)
void setTransitionVisibility(int arg0)
void setTranslationX(float arg0)
void setTranslationY(float arg0)
void setTranslationZ(float arg0)
void setVerticalFadingEdgeEnabled(boolean arg0)
void setVerticalScrollBarEnabled(boolean arg0)
void setVerticalScrollbarPosition(int arg0)
void setVerticalScrollbarThumbDrawable(Drawable arg0)
void setVerticalScrollbarTrackDrawable(Drawable arg0)
void setViewTranslationCallback(ViewTranslationCallback arg0)
void setVisibility(int arg0)
void setWillNotCacheDrawing(boolean arg0)
void setWillNotDraw(boolean arg0)
void setWindowInsetsAnimationCallback(WindowInsetsAnimation.Callback arg0)
void setX(float arg0)
void setY(float arg0)
void setZ(float arg0)
boolean showContextMenu()
boolean showContextMenu(float arg0, float arg1)
ActionMode startActionMode(ActionMode.Callback arg0, int arg1)
ActionMode startActionMode(ActionMode.Callback arg0)
void startAnimation(Animation arg0)
final boolean startDrag(ClipData arg0, View.DragShadowBuilder arg1, Object arg2, int arg3)
final boolean startDragAndDrop(ClipData arg0, View.DragShadowBuilder arg1, Object arg2, int arg3)
boolean startNestedScroll(int arg0)
void stopNestedScroll()
String toString()
void transformMatrixToGlobal(Matrix arg0)
void transformMatrixToLocal(Matrix arg0)
void unscheduleDrawable(Drawable arg0, Runnable arg1)
void unscheduleDrawable(Drawable arg0)
final void updateDragShadow(View.DragShadowBuilder arg0)
boolean verifyDrawable(Drawable arg0)
boolean willNotCacheDrawing()
boolean willNotDraw()
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()
abstract void bringChildToFront(View arg0)
abstract boolean canResolveLayoutDirection()
abstract boolean canResolveTextAlignment()
abstract boolean canResolveTextDirection()
abstract void childDrawableStateChanged(View arg0)
abstract void childHasTransientStateChanged(View arg0, boolean arg1)
abstract void clearChildFocus(View arg0)
abstract void createContextMenu(ContextMenu arg0)
default OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(View arg0, View arg1)
abstract View focusSearch(View arg0, int arg1)
abstract void focusableViewAvailable(View arg0)
abstract boolean getChildVisibleRect(View arg0, Rect arg1, Point arg2)
abstract int getLayoutDirection()
abstract ViewParent getParent()
abstract ViewParent getParentForAccessibility()
abstract int getTextAlignment()
abstract int getTextDirection()
abstract void invalidateChild(View arg0, Rect arg1)
abstract ViewParent invalidateChildInParent(int[] arg0, Rect arg1)
abstract boolean isLayoutDirectionResolved()
abstract boolean isLayoutRequested()
abstract boolean isTextAlignmentResolved()
abstract boolean isTextDirectionResolved()
abstract View keyboardNavigationClusterSearch(View arg0, int arg1)
abstract void notifySubtreeAccessibilityStateChanged(View arg0, View arg1, int arg2)
default void onDescendantInvalidated(View arg0, View arg1)
abstract boolean onNestedFling(View arg0, float arg1, float arg2, boolean arg3)
abstract boolean onNestedPreFling(View arg0, float arg1, float arg2)
abstract boolean onNestedPrePerformAccessibilityAction(View arg0, int arg1, Bundle arg2)
abstract void onNestedPreScroll(View arg0, int arg1, int arg2, int[] arg3)
abstract void onNestedScroll(View arg0, int arg1, int arg2, int arg3, int arg4)
abstract void onNestedScrollAccepted(View arg0, View arg1, int arg2)
abstract boolean onStartNestedScroll(View arg0, View arg1, int arg2)
abstract void onStopNestedScroll(View arg0)
abstract void recomputeViewAttributes(View arg0)
abstract void requestChildFocus(View arg0, View arg1)
abstract boolean requestChildRectangleOnScreen(View arg0, Rect arg1, boolean arg2)
abstract void requestDisallowInterceptTouchEvent(boolean arg0)
abstract void requestFitSystemWindows()
abstract void requestLayout()
abstract boolean requestSendAccessibilityEvent(View arg0, AccessibilityEvent arg1)
abstract void requestTransparentRegion(View arg0)
abstract boolean showContextMenuForChild(View arg0)
abstract boolean showContextMenuForChild(View arg0, float arg1, float arg2)
abstract ActionMode startActionModeForChild(View arg0, ActionMode.Callback arg1, int arg2)
abstract ActionMode startActionModeForChild(View arg0, ActionMode.Callback arg1)
abstract void addView(View arg0, ViewGroup.LayoutParams arg1)
abstract void removeView(View arg0)
abstract void updateViewLayout(View arg0, ViewGroup.LayoutParams arg1)
abstract void invalidateDrawable(Drawable arg0)
abstract void scheduleDrawable(Drawable arg0, Runnable arg1, long arg2)
abstract void unscheduleDrawable(Drawable arg0, Runnable arg1)
abstract boolean onKeyDown(int arg0, KeyEvent arg1)
abstract boolean onKeyLongPress(int arg0, KeyEvent arg1)
abstract boolean onKeyMultiple(int arg0, int arg1, KeyEvent arg2)
abstract boolean onKeyUp(int arg0, KeyEvent arg1)
abstract void sendAccessibilityEvent(int arg0)
abstract void sendAccessibilityEventUnchecked(AccessibilityEvent arg0)
abstract void onGlobalLayout()

XML attributes

TextInputLayout_android_hint

Related methods:

TextInputLayout_android_maxEms

Related methods:

TextInputLayout_android_maxWidth

Related methods:

TextInputLayout_android_minEms

Related methods:

TextInputLayout_android_minWidth

Related methods:

TextInputLayout_boxCollapsedPaddingTop

Related methods:

TextInputLayout_boxStrokeErrorColor

Related methods:

TextInputLayout_boxStrokeWidth

Related methods:

TextInputLayout_boxStrokeWidthFocused

Related methods:

TextInputLayout_counterEnabled

Related methods:

TextInputLayout_counterMaxLength

Related methods:

TextInputLayout_counterOverflowTextAppearance

Related methods:

TextInputLayout_counterOverflowTextColor

Related methods:

TextInputLayout_counterTextAppearance

Related methods:

TextInputLayout_counterTextColor

Related methods:

TextInputLayout_cursorColor

Related methods:

TextInputLayout_cursorErrorColor

Related methods:

TextInputLayout_endIconCheckable

Related methods:

TextInputLayout_endIconContentDescription

Related methods:

TextInputLayout_endIconDrawable

Related methods:

TextInputLayout_endIconMode

Related methods:

TextInputLayout_endIconTint

Related methods:

TextInputLayout_endIconTintMode

Related methods:

TextInputLayout_errorAccessibilityLiveRegion

Related methods:

TextInputLayout_errorContentDescription

Related methods:

TextInputLayout_errorEnabled

Related methods:

TextInputLayout_errorIconDrawable

Related methods:

TextInputLayout_errorIconTint

Related methods:

TextInputLayout_errorIconTintMode

Related methods:

TextInputLayout_errorTextAppearance

Related methods:

TextInputLayout_helperTextEnabled

Related methods:

TextInputLayout_helperTextTextAppearance

Related methods:

TextInputLayout_hintAnimationEnabled

Related methods:

TextInputLayout_hintEnabled

Related methods:

TextInputLayout_hintTextAppearance

Related methods:

TextInputLayout_hintTextColor

Related methods:

TextInputLayout_passwordToggleContentDescription

Related methods:

TextInputLayout_passwordToggleDrawable

Related methods:

TextInputLayout_passwordToggleEnabled

Related methods:

TextInputLayout_passwordToggleTint

Related methods:

TextInputLayout_passwordToggleTintMode

Related methods:

TextInputLayout_placeholderTextAppearance

Related methods:

TextInputLayout_placeholderTextColor

Related methods:

TextInputLayout_prefixTextAppearance

Related methods:

TextInputLayout_prefixTextColor

Related methods:

TextInputLayout_startIconCheckable

Related methods:

TextInputLayout_startIconContentDescription

Related methods:

TextInputLayout_startIconDrawable

Related methods:

TextInputLayout_startIconTint

Related methods:

TextInputLayout_startIconTintMode

Related methods:

TextInputLayout_suffixTextAppearance

Related methods:

TextInputLayout_suffixTextColor

Related methods:

Constants

BOX_BACKGROUND_FILLED

public static final int BOX_BACKGROUND_FILLED

Constant Value: 1 (0x00000001)

BOX_BACKGROUND_NONE

public static final int BOX_BACKGROUND_NONE

Constant Value: 0 (0x00000000)

BOX_BACKGROUND_OUTLINE

public static final int BOX_BACKGROUND_OUTLINE

Constant Value: 2 (0x00000002)

END_ICON_CLEAR_TEXT

public static final int END_ICON_CLEAR_TEXT

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.

Constant Value: 2 (0x00000002)

END_ICON_CUSTOM

public static final int END_ICON_CUSTOM

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

Constant Value: -1 (0xffffffff)

END_ICON_DROPDOWN_MENU

public static final int END_ICON_DROPDOWN_MENU

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.

Constant Value: 3 (0x00000003)

END_ICON_NONE

public static final int END_ICON_NONE

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

Constant Value: 0 (0x00000000)

END_ICON_PASSWORD_TOGGLE

public static final int END_ICON_PASSWORD_TOGGLE

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.

Constant Value: 1 (0x00000001)

Public constructors

TextInputLayout

public TextInputLayout (Context context)

Parameters
context Context

TextInputLayout

public TextInputLayout (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

TextInputLayout

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

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

addOnEditTextAttachedListener

public void addOnEditTextAttachedListener (TextInputLayout.OnEditTextAttachedListener listener)

Add a 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 removeOnEditTextAttachedListener(OnEditTextAttachedListener).

Parameters
listener TextInputLayout.OnEditTextAttachedListener: listener to add

addOnEndIconChangedListener

public void addOnEndIconChangedListener (TextInputLayout.OnEndIconChangedListener listener)

Add a 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 removeOnEndIconChangedListener(OnEndIconChangedListener).

Parameters
listener TextInputLayout.OnEndIconChangedListener: listener to add

addView

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

Parameters
child View

index int

params ViewGroup.LayoutParams

clearOnEditTextAttachedListeners

public void clearOnEditTextAttachedListeners ()

Remove all previously added TextInputLayout.OnEditTextAttachedListeners.

clearOnEndIconChangedListeners

public void clearOnEndIconChangedListeners ()

Remove all previously added TextInputLayout.OnEndIconChangedListeners.

dispatchProvideAutofillStructure

public void dispatchProvideAutofillStructure (ViewStructure structure, 
                int flags)

Parameters
structure ViewStructure

flags int

draw

public void draw (Canvas canvas)

Parameters
canvas Canvas

getBaseline

public int getBaseline ()

Returns
int

getBoxBackgroundColor

public int getBoxBackgroundColor ()

Returns the filled box's default background color.

Returns
int the color used for the filled box's background

getBoxBackgroundMode

public int getBoxBackgroundMode ()

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

May be one of BOX_BACKGROUND_NONE, BOX_BACKGROUND_FILLED, or BOX_BACKGROUND_OUTLINE.

Returns
int

getBoxCollapsedPaddingTop

public int getBoxCollapsedPaddingTop ()

Returns the EditText's collapsed top padding

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

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

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

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

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

getBoxStrokeColor

public int getBoxStrokeColor ()

Returns the box's stroke focused color.

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

getBoxStrokeErrorColor

public ColorStateList getBoxStrokeErrorColor ()

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

Related XML Attributes:

Returns
ColorStateList

getBoxStrokeWidth

public int getBoxStrokeWidth ()

Returns the box's stroke width.

Returns
int the value used for the box's stroke width

getBoxStrokeWidthFocused

public int getBoxStrokeWidthFocused ()

Returns the box's stroke focused width.

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

getCounterMaxLength

public int getCounterMaxLength ()

Returns the max length shown at the character counter.

Related XML Attributes:

Returns
int

getCounterOverflowTextColor

public ColorStateList getCounterOverflowTextColor ()

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

Related XML Attributes:

Returns
ColorStateList the text color used for the overflowed character counter

getCounterTextColor

public ColorStateList getCounterTextColor ()

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

Related XML Attributes:

Returns
ColorStateList the text color used for the character counter

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.

Related XML Attributes:

Returns
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.

Related XML Attributes:

Returns
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.

Returns
ColorStateList

getEditText

public EditText getEditText ()

Returns the EditText used for text input.

Returns
EditText

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.

Returns
CharSequence

getEndIconDrawable

public Drawable getEndIconDrawable ()

Returns the drawable currently used for the end icon.

Related XML Attributes:

Returns
Drawable

getEndIconMinSize

public int getEndIconMinSize ()

Returns the minimum size of the end icon.

Returns
int Returns the size of the end icon in pixels.

getEndIconMode

public int getEndIconMode ()

Returns the current end icon mode.

Related XML Attributes:

Returns
int the end icon mode enum

getEndIconScaleType

public ImageView.ScaleType getEndIconScaleType ()

Returns the ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

Returns
ImageView.ScaleType Returns the ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

getError

public CharSequence getError ()

Returns the error message that was set to be displayed with setError(CharSequence), or null if no error was set or if error displaying is not enabled.

Returns
CharSequence

getErrorAccessibilityLiveRegion

public int getErrorAccessibilityLiveRegion ()

Returns the accessibility live region of the error message.

Returns
int

getErrorContentDescription

public CharSequence getErrorContentDescription ()

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

Returns
CharSequence

getErrorCurrentTextColors

public int getErrorCurrentTextColors ()

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

Returns
int

getErrorIconDrawable

public Drawable getErrorIconDrawable ()

Returns the drawable currently used for the error icon.

Related XML Attributes:

Returns
Drawable

getHelperText

public CharSequence getHelperText ()

Returns the helper message that was set to be displayed with setHelperText(CharSequence), or null if no helper text was set or if helper text functionality is not enabled.

Returns
CharSequence

getHelperTextCurrentTextColor

public int getHelperTextCurrentTextColor ()

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

Returns
int

getHint

public CharSequence getHint ()

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

Related XML Attributes:

Returns
CharSequence the hint, or null if there isn't one set, or the hint is not enabled.

getHintTextColor

public ColorStateList getHintTextColor ()

Gets the collapsed hint text color.

Related XML Attributes:

Returns
ColorStateList

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.

Related XML Attributes:

Returns
int

See also:

getMaxWidth

public int getMaxWidth ()

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

Related XML Attributes:

Returns
int

getMinEms

public int getMinEms ()

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

Related XML Attributes:

Returns
int

See also:

getMinWidth

public int getMinWidth ()

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

Related XML Attributes:

Returns
int

getPasswordVisibilityToggleContentDescription

public CharSequence getPasswordVisibilityToggleContentDescription ()

This method is deprecated.
Use 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.

Returns
CharSequence

getPasswordVisibilityToggleDrawable

public Drawable getPasswordVisibilityToggleDrawable ()

This method is deprecated.
Use getEndIconDrawable() instead.

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

Related XML Attributes:

Returns
Drawable

getPlaceholderText

public CharSequence getPlaceholderText ()

Returns the placeholder text that was set to be displayed with setPlaceholderText(CharSequence), or null if there is no placeholder text.

Returns
CharSequence

getPlaceholderTextAppearance

public int getPlaceholderTextAppearance ()

Returns the TextAppearance resource used for the placeholder text color.

Related XML Attributes:

Returns
int

getPlaceholderTextColor

public ColorStateList getPlaceholderTextColor ()

Returns the ColorStateList used for the placeholder text.

Related XML Attributes:

Returns
ColorStateList

getPrefixText

public CharSequence getPrefixText ()

Returns the prefix text that was set to be displayed with setPrefixText(CharSequence), or null if there is no prefix text.

Returns
CharSequence

getPrefixTextColor

public ColorStateList getPrefixTextColor ()

Returns the ColorStateList used for the prefix text.

Related XML Attributes:

Returns
ColorStateList

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 setPrefixText(CharSequence), instead of on the TextView directly.

Returns
TextView

getShapeAppearanceModel

public ShapeAppearanceModel getShapeAppearanceModel ()

Returns the ShapeAppearanceModel of the text field's box background.

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.

Returns
CharSequence

getStartIconDrawable

public Drawable getStartIconDrawable ()

Returns the start icon.

Related XML Attributes:

Returns
Drawable the drawable used for the start icon

getStartIconMinSize

public int getStartIconMinSize ()

Returns the size of the start icon.

Returns
int Returns the size of the start icon in pixels.

getStartIconScaleType

public ImageView.ScaleType getStartIconScaleType ()

Returns the ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

Returns
ImageView.ScaleType Returns the ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

getSuffixText

public CharSequence getSuffixText ()

Returns the suffix text that was set to be displayed with setSuffixText(CharSequence), or null if there is no suffix text.

Returns
CharSequence

getSuffixTextColor

public ColorStateList getSuffixTextColor ()

Returns the ColorStateList used for the suffix text.

Related XML Attributes:

Returns
ColorStateList

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 setSuffixText(CharSequence), instead of on the TextView directly.

Returns
TextView

getTypeface

public Typeface getTypeface ()

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

Returns
Typeface

isCounterEnabled

public boolean isCounterEnabled ()

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

Related XML Attributes:

Returns
boolean

isEndIconCheckable

public boolean isEndIconCheckable ()

Returns whether the end icon is checkable.

Returns
boolean

isEndIconVisible

public boolean isEndIconVisible ()

Returns whether the current end icon is visible.

Returns
boolean

isErrorEnabled

public boolean isErrorEnabled ()

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

Related XML Attributes:

Returns
boolean

isExpandedHintEnabled

public boolean isExpandedHintEnabled ()

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

Returns
boolean

isHelperTextEnabled

public boolean isHelperTextEnabled ()

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

Related XML Attributes:

Returns
boolean

isHintAnimationEnabled

public boolean isHintAnimationEnabled ()

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

Related XML Attributes:

Returns
boolean

isHintEnabled

public boolean isHintEnabled ()

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

Related XML Attributes:

Returns
boolean

isPasswordVisibilityToggleEnabled

public boolean isPasswordVisibilityToggleEnabled ()

This method is deprecated.
Use getEndIconMode() instead.

Returns whether the password visibility toggle functionality is currently enabled.

Returns
boolean

isStartIconCheckable

public boolean isStartIconCheckable ()

Returns whether the start icon is checkable.

Returns
boolean

isStartIconVisible

public boolean isStartIconVisible ()

Returns whether the current start icon is visible.

Returns
boolean

onGlobalLayout

public void onGlobalLayout ()

onRtlPropertiesChanged

public void onRtlPropertiesChanged (int layoutDirection)

Parameters
layoutDirection int

onSaveInstanceState

public Parcelable onSaveInstanceState ()

Returns
Parcelable

passwordVisibilityToggleRequested

public void passwordVisibilityToggleRequested (boolean shouldSkipAnimations)

This method is deprecated.
The password toggle will show as checked or unchecked depending on whether the EditText's TransformationMethod is of type 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
shouldSkipAnimations boolean: 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 TextInputLayout.OnEditTextAttachedListener that was previously added via addOnEditTextAttachedListener(OnEditTextAttachedListener).

Parameters
listener TextInputLayout.OnEditTextAttachedListener: listener to remove

removeOnEndIconChangedListener

public void removeOnEndIconChangedListener (TextInputLayout.OnEndIconChangedListener listener)

Remove the given TextInputLayout.OnEndIconChangedListener that was previously added via addOnEndIconChangedListener(OnEndIconChangedListener).

Parameters
listener TextInputLayout.OnEndIconChangedListener: 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 BOX_BACKGROUND_FILLED, the box background color may not work as intended.

Parameters
boxBackgroundColor int: the color to use for the filled box's background

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 BOX_BACKGROUND_FILLED, the box background color may not work as intended.

Parameters
boxBackgroundColorId int: 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 BOX_BACKGROUND_FILLED, the box background color may not work as intended.

Parameters
boxBackgroundColorStateList ColorStateList: the color state list to use for the box's background color

setBoxBackgroundMode

public void setBoxBackgroundMode (int boxBackgroundMode)

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

May be one of BOX_BACKGROUND_NONE, BOX_BACKGROUND_FILLED, or 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 setBoxStrokeColor(int) and setBoxBackgroundColor(int).

Parameters
boxBackgroundMode int: box's background mode

Throws
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.

Related XML Attributes:

Parameters
boxCollapsedPaddingTop int: the value to use for the EditText's collapsed top padding

setBoxCornerFamily

public void setBoxCornerFamily (int cornerFamily)

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

Parameters
cornerFamily int: the CornerFamily to be used. May be one of CornerFamily.ROUNDED or CornerFamily.CUT.

setBoxCornerRadii

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

Set the box's corner radii.

Parameters
boxCornerRadiusTopStart float: the value to use for the box's top start corner radius

boxCornerRadiusTopEnd float: the value to use for the box's top end corner radius

boxCornerRadiusBottomStart float: the value to use for the box's bottom start corner radius

boxCornerRadiusBottomEnd float: the value to use for the box's bottom end corner radius

setBoxCornerRadiiResources

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

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

Parameters
boxCornerRadiusTopStartId int: the resource to use for the box's top start corner radius

boxCornerRadiusTopEndId int: the resource to use for the box's top end corner radius

boxCornerRadiusBottomEndId int: the resource to use for the box's bottom end corner radius

boxCornerRadiusBottomStartId int: 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
boxStrokeColor int: the color to use for the box's stroke when focused

setBoxStrokeColorStateList

public void setBoxStrokeColorStateList (ColorStateList boxStrokeColorStateList)

Set the box's stroke color state list.

Parameters
boxStrokeColorStateList ColorStateList: 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
strokeErrorColor ColorStateList: the error color to use for the box's stroke

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.

Related XML Attributes:

Parameters
boxStrokeWidth int: the value to use for the box's stroke

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.

Related XML Attributes:

Parameters
boxStrokeWidthFocused int: the value to use for the box's stroke when focused

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.

Related XML Attributes:

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

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.

Related XML Attributes:

Parameters
boxStrokeWidthResId int: the resource dimension to use for the box's stroke width

setCounterEnabled

public void setCounterEnabled (boolean enabled)

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

Related XML Attributes:

Parameters
enabled boolean

setCounterMaxLength

public void setCounterMaxLength (int maxLength)

Sets the max length to display at the character counter.

Related XML Attributes:

Parameters
maxLength int: 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.

Related XML Attributes:

Parameters
counterOverflowTextAppearance int

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.

Related XML Attributes:

Parameters
counterOverflowTextColor ColorStateList: the text color used for the overflowed character counter

setCounterTextAppearance

public void setCounterTextAppearance (int counterTextAppearance)

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

Related XML Attributes:

Parameters
counterTextAppearance int

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.

Related XML Attributes:

Parameters
counterTextColor ColorStateList: 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.

Related XML Attributes:

Parameters
cursorColor ColorStateList: the cursor color to be set

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.

Related XML Attributes:

Parameters
cursorErrorColor ColorStateList: the error color to use for the cursor

setDefaultHintTextColor

public void setDefaultHintTextColor (ColorStateList textColor)

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

Parameters
textColor ColorStateList

setEnabled

public void setEnabled (boolean enabled)

Parameters
enabled boolean

setEndIconActivated

public void setEndIconActivated (boolean endIconActivated)

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

Parameters
endIconActivated boolean: 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.

Related XML Attributes:

Parameters
endIconCheckable boolean: whether the icon should be checkable

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.

Related XML Attributes:

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

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.

Related XML Attributes:

Parameters
endIconContentDescription CharSequence: Content description to set, or null to clear the content description

setEndIconDrawable

public void setEndIconDrawable (Drawable endIconDrawable)

Set the icon to use for the end icon. This method should be called after specifying an TextInputLayout.EndIconMode via setEndIconMode(int).

If you use an icon you should also set a description for its action using setEndIconContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

Parameters
endIconDrawable Drawable: 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 TextInputLayout.EndIconMode via setEndIconMode(int).

If you use an icon you should also set a description for its action using setEndIconContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

Parameters
resId int: 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.

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

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.

Related XML Attributes:

Parameters
endIconMode int: the end icon mode to be set: END_ICON_PASSWORD_TOGGLE, END_ICON_CLEAR_TEXT, or END_ICON_CUSTOM; or END_ICON_NONE to clear the current icon if any

setEndIconOnClickListener

public void setEndIconOnClickListener (View.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
endIconOnClickListener View.OnClickListener: the View.OnClickListener the end icon view will have

setEndIconOnLongClickListener

public void setEndIconOnLongClickListener (View.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
endIconOnLongClickListener View.OnLongClickListener: the View.OnLongClickListener the end icon view will have, or null to clear it.

setEndIconScaleType

public void setEndIconScaleType (ImageView.ScaleType scaleType)

Sets ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

Parameters
scaleType ImageView.ScaleType: ERROR(/ImageView.ScaleType) for the end icon's ImageButton.

setEndIconTintList

public void setEndIconTintList (ColorStateList endIconTintList)

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

Subsequent calls to setEndIconDrawable(Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using DrawableCompat.setTintList(Drawable, ColorStateList).

Related XML Attributes:

Parameters
endIconTintList ColorStateList: the tint to apply, may be null to clear tint

setEndIconTintMode

public void setEndIconTintMode (PorterDuff.Mode endIconTintMode)

Specifies the blending mode used to apply the tint specified by setEndIconTintList(ColorStateList) to the end icon drawable. The default mode is PorterDuff.Mode.SRC_IN.

Related XML Attributes:

Parameters
endIconTintMode PorterDuff.Mode: 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
visible boolean: 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 setErrorEnabled(boolean), then it will be automatically enabled if error is not empty.

Parameters
errorText CharSequence: Error message to display, or null to clear

See also:

setErrorAccessibilityLiveRegion

public void setErrorAccessibilityLiveRegion (int errorAccessibilityLiveRegion)

Sets an accessibility live region for the error message.

Related XML Attributes:

Parameters
errorAccessibilityLiveRegion int: 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.

Related XML Attributes:

Parameters
errorContentDescription CharSequence: 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 setError(CharSequence), will mean that this layout will not change size when an error is displayed.

Related XML Attributes:

Parameters
enabled boolean

setErrorIconDrawable

public void setErrorIconDrawable (int resId)

Set the drawable to use for the error icon.

Related XML Attributes:

Parameters
resId int: resource id of the drawable to set, or 0 to clear the icon

setErrorIconDrawable

public void setErrorIconDrawable (Drawable errorIconDrawable)

Set the drawable to use for the error icon.

Related XML Attributes:

Parameters
errorIconDrawable Drawable: Drawable to set, may be null to clear the icon

setErrorIconOnClickListener

public void setErrorIconOnClickListener (View.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
errorIconOnClickListener View.OnClickListener: the View.OnClickListener the error icon view will have

setErrorIconOnLongClickListener

public void setErrorIconOnLongClickListener (View.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
errorIconOnLongClickListener View.OnLongClickListener: the 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.

Related XML Attributes:

Parameters
errorIconTintList ColorStateList: the tint to apply, may be null to clear tint

setErrorIconTintMode

public void setErrorIconTintMode (PorterDuff.Mode errorIconTintMode)

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

Related XML Attributes:

Parameters
errorIconTintMode PorterDuff.Mode: 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.

Related XML Attributes:

Parameters
errorTextAppearance int

setErrorTextColor

public void setErrorTextColor (ColorStateList errorTextColor)

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

Parameters
errorTextColor ColorStateList

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.

Parameters
enabled boolean

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 setHelperTextEnabled(boolean), then it will be automatically enabled if helper is not empty.

Parameters
helperText CharSequence: Helper text to display

See also:

setHelperTextColor

public void setHelperTextColor (ColorStateList helperTextColor)

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

Parameters
helperTextColor ColorStateList

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 setHelperText(CharSequence) will mean that this layout will not change size when a helper message is displayed.

Related XML Attributes:

Parameters
enabled boolean

setHelperTextTextAppearance

public void setHelperTextTextAppearance (int helperTextTextAppearance)

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

Related XML Attributes:

Parameters
helperTextTextAppearance int

setHint

public void setHint (CharSequence hint)

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

Related XML Attributes:

Parameters
hint CharSequence

setHint

public void setHint (int textHintId)

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

Parameters
textHintId int: The resource id of the text to display in the floating label

setHintAnimationEnabled

public void setHintAnimationEnabled (boolean enabled)

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

Related XML Attributes:

Parameters
enabled boolean

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.

Related XML Attributes:

Parameters
enabled boolean

setHintTextAppearance

public void setHintTextAppearance (int resId)

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

Related XML Attributes:

Parameters
resId int

setHintTextColor

public void setHintTextColor (ColorStateList hintTextColor)

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

Related XML Attributes:

Parameters
hintTextColor ColorStateList

setLengthCounter

public void setLengthCounter (TextInputLayout.LengthCounter lengthCounter)

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

Parameters
lengthCounter TextInputLayout.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.

Related XML Attributes:

Parameters
maxEms int: The maximum width in terms of ems to be set

See also:

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.

Related XML Attributes:

Parameters
maxWidth int: The maximum width to be set

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.

Related XML Attributes:

Parameters
maxWidthId int: The id of the maximum width dimension resource to be set

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.

Related XML Attributes:

Parameters
minEms int: The minimum width in terms of ems to be set

See also:

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.

Related XML Attributes:

Parameters
minWidth int: The minimum width to be set

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.

Related XML Attributes:

Parameters
minWidthId int: The id of the minimum width dimension resource to be set

setPasswordVisibilityToggleContentDescription

public void setPasswordVisibilityToggleContentDescription (CharSequence description)

This method is deprecated.
Use setEndIconContentDescription(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.

Related XML Attributes:

Parameters
description CharSequence: Content description to set, or null to clear the content description

setPasswordVisibilityToggleContentDescription

public void setPasswordVisibilityToggleContentDescription (int resId)

This method is deprecated.
Use 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.

Related XML Attributes:

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

setPasswordVisibilityToggleDrawable

public void setPasswordVisibilityToggleDrawable (Drawable icon)

This method is deprecated.
Use 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 setPasswordVisibilityToggleContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

Parameters
icon Drawable: Drawable to set, may be null to clear the icon

setPasswordVisibilityToggleDrawable

public void setPasswordVisibilityToggleDrawable (int resId)

This method is deprecated.
Use 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 setPasswordVisibilityToggleContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

Parameters
resId int: resource id of the drawable to set, or 0 to clear the icon

setPasswordVisibilityToggleEnabled

public void setPasswordVisibilityToggleEnabled (boolean enabled)

This method is deprecated.
Use 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.

Related XML Attributes:

Parameters
enabled boolean: true to enable the functionality

setPasswordVisibilityToggleTintList

public void setPasswordVisibilityToggleTintList (ColorStateList tintList)

This method is deprecated.
Use setEndIconTintList(ColorStateList) instead.

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

Subsequent calls to setPasswordVisibilityToggleDrawable(Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using DrawableCompat.setTintList(Drawable, ColorStateList).

Related XML Attributes:

Parameters
tintList ColorStateList: the tint to apply, may be null to clear tint

setPasswordVisibilityToggleTintMode

public void setPasswordVisibilityToggleTintMode (PorterDuff.Mode mode)

This method is deprecated.
Use setEndIconTintMode(PorterDuff.Mode) instead.

Specifies the blending mode used to apply the tint specified by setPasswordVisibilityToggleTintList(ColorStateList) to the password visibility toggle drawable. The default mode is PorterDuff.Mode.SRC_IN.

Related XML Attributes:

Parameters
mode PorterDuff.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
placeholderText CharSequence: Placeholder text to display

setPlaceholderTextAppearance

public void setPlaceholderTextAppearance (int placeholderTextAppearance)

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

Related XML Attributes:

Parameters
placeholderTextAppearance int

setPlaceholderTextColor

public void setPlaceholderTextColor (ColorStateList placeholderTextColor)

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

Related XML Attributes:

Parameters
placeholderTextColor ColorStateList

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
prefixText CharSequence: Prefix text to display

See also:

setPrefixTextAppearance

public void setPrefixTextAppearance (int prefixTextAppearance)

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

Related XML Attributes:

Parameters
prefixTextAppearance int

setPrefixTextColor

public void setPrefixTextColor (ColorStateList prefixTextColor)

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

Related XML Attributes:

Parameters
prefixTextColor ColorStateList

setShapeAppearanceModel

public void setShapeAppearanceModel (ShapeAppearanceModel shapeAppearanceModel)

Sets the ShapeAppearanceModel of the text field's box background.

Parameters
shapeAppearanceModel ShapeAppearanceModel: the desired shape appearance model.

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.

Related XML Attributes:

Parameters
startIconCheckable boolean: whether the icon should be checkable

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.

Related XML Attributes:

Parameters
startIconContentDescription CharSequence: Content description to set, or null to clear the content description

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.

Related XML Attributes:

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

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 setStartIconContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

Parameters
startIconDrawable Drawable: Drawable to set, may be null to clear and remove the icon

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 setStartIconContentDescription(CharSequence). This is used for accessibility.

Related XML Attributes:

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

setStartIconMinSize

public void setStartIconMinSize (int iconSize)

Sets the width and height of the start icon.

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

setStartIconOnClickListener

public void setStartIconOnClickListener (View.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
startIconOnClickListener View.OnClickListener: the View.OnClickListener the start icon view will have, or null to clear it.

setStartIconOnLongClickListener

public void setStartIconOnLongClickListener (View.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
startIconOnLongClickListener View.OnLongClickListener: the View.OnLongClickListener the start icon view will have, or null to clear it.

setStartIconScaleType

public void setStartIconScaleType (ImageView.ScaleType scaleType)

Sets ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

Parameters
scaleType ImageView.ScaleType: ERROR(/ImageView.ScaleType) for the start icon's ImageButton.

setStartIconTintList

public void setStartIconTintList (ColorStateList startIconTintList)

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

Subsequent calls to setStartIconDrawable(Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using DrawableCompat.setTintList(Drawable, ColorStateList).

Related XML Attributes:

Parameters
startIconTintList ColorStateList: the tint to apply, may be null to clear tint

setStartIconTintMode

public void setStartIconTintMode (PorterDuff.Mode startIconTintMode)

Specifies the blending mode used to apply the tint specified by setEndIconTintList(ColorStateList) to the start icon drawable. The default mode is PorterDuff.Mode.SRC_IN.

Related XML Attributes:

Parameters
startIconTintMode PorterDuff.Mode: 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
visible boolean: 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
suffixText CharSequence: Suffix text to display

See also:

setSuffixTextAppearance

public void setSuffixTextAppearance (int suffixTextAppearance)

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

Related XML Attributes:

Parameters
suffixTextAppearance int

setSuffixTextColor

public void setSuffixTextColor (ColorStateList suffixTextColor)

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

Related XML Attributes:

Parameters
suffixTextColor ColorStateList

setTextInputAccessibilityDelegate

public void setTextInputAccessibilityDelegate (TextInputLayout.AccessibilityDelegate delegate)

Sets an TextInputLayout.AccessibilityDelegate providing an accessibility implementation for the EditText used by this layout.

Note: This method should be used in place of providing an TextInputLayout.AccessibilityDelegate directly on the EditText.

Parameters
delegate TextInputLayout.AccessibilityDelegate

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)

Parameters
container SparseArray

drawableStateChanged

protected void drawableStateChanged ()

onConfigurationChanged

protected void onConfigurationChanged (Configuration newConfig)

Parameters
newConfig Configuration

onLayout

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

Parameters
changed boolean

left int

top int

right int

bottom int

onMeasure

protected void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int

onRestoreInstanceState

protected void onRestoreInstanceState (Parcelable state)

Parameters
state Parcelable