Most visited

Recently visited

TextInputEditText

public class TextInputEditText
extends AppCompatEditText

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.EditText
         ↳ android.support.v7.widget.AppCompatEditText
           ↳ android.support.design.widget.TextInputEditText


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

Using this class allows us to display a hint in the IME when in 'extract' mode.

Summary

Inherited XML attributes

From class android.widget.TextView
From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

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

Public methods

InputConnection onCreateInputConnection(EditorInfo outAttrs)

Create a new InputConnection for an InputMethod to interact with the view.

Inherited methods

From class android.support.v7.widget.AppCompatEditText
From class android.widget.EditText
From class android.widget.TextView
From class android.view.View
From class java.lang.Object
From interface android.support.v4.view.TintableBackgroundView
From interface android.view.ViewTreeObserver.OnPreDrawListener
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

TextInputEditText

TextInputEditText (Context context)

Parameters
context Context

TextInputEditText

TextInputEditText (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

TextInputEditText

TextInputEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context
attrs AttributeSet
defStyleAttr int

Public methods

onCreateInputConnection

InputConnection onCreateInputConnection (EditorInfo outAttrs)

Create a new InputConnection for an InputMethod to interact with the view. The default implementation returns null, since it doesn't support input methods. You can override this to implement such support. This is only needed for views that take focus and text input.

When implementing this, you probably also want to implement onCheckIsTextEditor() to indicate you will return a non-null InputConnection.

Also, take good care to fill in the EditorInfo object correctly and in its entirety, so that the connected IME can rely on its values. For example, initialSelStart and initialSelEnd members must be filled in with the correct cursor position for IMEs to work correctly with your application.

Parameters
outAttrs EditorInfo: Fill in with attribute information about the connection.
Returns
InputConnection

Hooray!