AppCompatEditText
public
class
AppCompatEditText
extends EditText
implements
TintableBackgroundView,
OnReceiveContentViewBehavior,
EmojiCompatConfigurationView
| java.lang.Object | ||||
| ↳ | android.view.View | |||
| ↳ | android.widget.TextView | |||
| ↳ | android.widget.EditText | |||
| ↳ | androidx.appcompat.widget.AppCompatEditText | |||
A EditText which supports compatible features on older versions of the platform,
including:
- Allows dynamic tint of its background via the background tint methods in
ViewCompat. - Allows setting of the background tint using
R.attr.backgroundTintandR.attr.backgroundTintMode. - Allows setting a custom
listenerto handle insertion of content (e.g. pasting text or an image from the clipboard). This listener provides the opportunity to implement app-specific handling such as creating an attachment when an image is pasted.
This will automatically be used when you use EditText in your layouts
and the top-level activity / dialog is provided by
appcompat.
You should only need to manually use this class when writing custom views.
Summary
Inherited constants |
|---|
Inherited fields |
|---|
Public constructors | |
|---|---|
AppCompatEditText(Context context)
|
|
AppCompatEditText(Context context, AttributeSet attrs)
|
|
AppCompatEditText(Context context, AttributeSet attrs, int defStyleAttr)
|
|
Public methods | |
|---|---|
ActionMode.Callback
|
getCustomSelectionActionModeCallback()
|
Editable
|
getText()
Return the text that the view is displaying. |
TextClassifier
|
getTextClassifier()
Returns the |
boolean
|
isEmojiCompatEnabled()
|
InputConnection
|
onCreateInputConnection(EditorInfo outAttrs)
If a |
boolean
|
onDragEvent(DragEvent event)
|
ContentInfoCompat
|
onReceiveContent(ContentInfoCompat payload)
Implements the default behavior for receiving content, which coerces all content to text and inserts into the view. |
boolean
|
onTextContextMenuItem(int id)
If a |
void
|
setBackgroundDrawable(<a href="https://developer.android.com/reference/android/graphics/draw
|