# TextInputEditText

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

*** ** * ** ***


```
public class TextInputEditText
```

<br />

*** ** * ** ***

A special sub-class of android.widget.EditText designed for use as a child of `https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout`.

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

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

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

## Summary

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

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#getFocusedRect(Rect)(Rect r)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#getGlobalVisibleRect(Rect,Point)(Rect r, Point globalOffset)` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#getHint()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#isTextInputLayoutFocusedRectEnabled()()` Whether the edit text is using the TextInputLayout's focused rectangle. |
| `InputConnection` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#onCreateInputConnection(EditorInfo)(EditorInfo outAttrs)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)(AccessibilityNodeInfo info)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#requestRectangleOnScreen(Rect)(Rect rectangle)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#setTextInputLayoutFocusedRectEnabled(boolean)( boolean textInputLayoutFocusedRectEnabled )` Whether the edit text should use the TextInputLayout's focused rectangle. |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText#onAttachedToWindow()()` |

## 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()
```