EmojiEditText

public class EmojiEditText
extends EditText

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.EditText
         ↳ androidx.emoji.widget.EmojiEditText


EditText widget enhanced with emoji capability by using EmojiEditTextHelper. When used on devices running API 18 or below, this widget acts as a regular EditText.

Summary

XML attributes

EmojiEditText_maxEmojiCount  

Inherited constants

Inherited fields

Public constructors

EmojiEditText(Context context)
EmojiEditText(Context context, AttributeSet attrs)
EmojiEditText(Context context, AttributeSet attrs, int defStyleAttr)
EmojiEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

int getMaxEmojiCount()

Returns the maximum number of EmojiSpans to be added to a CharSequence.

InputConnection onCreateInputConnection(EditorInfo outAttrs)
void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback)

See TextViewCompat.setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)

void setKeyListener(KeyListener keyListener)
void setMaxEmojiCount(int maxEmojiCount)

Set the maximum number of EmojiSpans to be added to a CharSequence.

Inherited methods

XML attributes

EmojiEditText_maxEmojiCount

Related methods:

Public constructors

EmojiEditText

public EmojiEditText (Context context)

Parameters
context Context

EmojiEditText

public EmojiEditText (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

EmojiEditText

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

Parameters
context Context

attrs AttributeSet

defStyleAttr int

EmojiEditText

public EmojiEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

getMaxEmojiCount

public int getMaxEmojiCount ()

Returns the maximum number of EmojiSpans to be added to a CharSequence.

Related XML Attributes:

Returns
int

onCreateInputConnection

public InputConnection onCreateInputConnection (EditorInfo outAttrs)

Parameters
outAttrs EditorInfo

Returns
InputConnection

setCustomSelectionActionModeCallback

public void setCustomSelectionActionModeCallback (ActionMode.Callback actionModeCallback)

See TextViewCompat.setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)

Parameters
actionModeCallback ActionMode.Callback

setKeyListener

public void setKeyListener (KeyListener keyListener)

Parameters
keyListener KeyListener

setMaxEmojiCount

public void setMaxEmojiCount (int maxEmojiCount)

Set the maximum number of EmojiSpans to be added to a CharSequence. The number of spans in a CharSequence affects the performance of the EditText insert/delete operations. Insert/delete operations slow down as the number of spans increases.

Related XML Attributes:

Parameters
maxEmojiCount int: maximum number of EmojiSpans to be added to a single CharSequence, should be equal or greater than 0