TextInputEditText

public class TextInputEditText


A special sub-class of android.widget.EditText designed for use as a child of .

Using this class allows us to display a hint in the IME when in 'extract' mode and provides accessibility support for com.google.android.material.textfield.TextInputLayout.

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

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

Summary

Public constructors

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

Public methods

void
boolean
getGlobalVisibleRect(Rect r, Point globalOffset)
CharSequence
boolean

Whether the edit text is using the TextInputLayout's focused rectangle.

InputConnection
onCreateInputConnection(EditorInfo outAttrs)
void
onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
boolean
requestRectangleOnScreen(Rect rectangle)
void
setTextInputLayoutFocusedRectEnabled(
    boolean textInputLayoutFocusedRectEnabled
)

Whether the edit text should use the TextInputLayout's focused rectangle.

Protected methods

void

Public constructors

TextInputEditText

public TextInputEditText(Context context)

TextInputEditText

public TextInputEditText(Context context, AttributeSet attrs)

TextInputEditText

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

Public methods

getFocusedRect

public void getFocusedRect(Rect r)

getGlobalVisibleRect

public boolean getGlobalVisibleRect(Rect r, Point globalOffset)

getHint

public CharSequence getHint()

isTextInputLayoutFocusedRectEnabled

public boolean isTextInputLayoutFocusedRectEnabled()

Whether the edit text is using the TextInputLayout's focused rectangle.

onCreateInputConnection

public InputConnection onCreateInputConnection(EditorInfo outAttrs)

onInitializeAccessibilityNodeInfo

public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)

requestRectangleOnScreen

public boolean requestRectangleOnScreen(Rect rectangle)

setTextInputLayoutFocusedRectEnabled

public void setTextInputLayoutFocusedRectEnabled(
    boolean textInputLayoutFocusedRectEnabled
)

Whether the edit text should use the TextInputLayout's focused rectangle.

Protected methods

onAttachedToWindow

protected void onAttachedToWindow()