added in version 1.0.0
belongs to Maven artifact androidx.emoji:emoji:1.0.0-beta01

EmojiExtractTextLayout

public class EmojiExtractTextLayout
extends LinearLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ androidx.emoji.widget.EmojiExtractTextLayout


Layout that contains emoji compatibility enhanced ExtractEditText. Should be used by InputMethodService implementations.

Call onUpdateExtractingViews(InputMethodService, EditorInfo) from InputMethodService#onUpdateExtractingViews(EditorInfo).

 public class MyInputMethodService extends InputMethodService {
     // ..
     @Override
     public View onCreateExtractTextView() {
         mExtractView = getLayoutInflater().inflate(R.layout.emoji_input_method_extract_layout,
                 null);
         return mExtractView;
     }

     @Override
     public void onUpdateExtractingViews(EditorInfo ei) {
         mExtractView.onUpdateExtractingViews(this, ei);
     }
 }
 

Summary

XML attributes

EmojiExtractTextLayout_emojiReplaceStrategy  

Inherited constants

Inherited fields

Public constructors

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

Public methods

int getEmojiReplaceStrategy()

Returns whether to replace all emoji with EmojiSpans.

void onUpdateExtractingViews(InputMethodService inputMethodService, EditorInfo ei)

Initializes the layout.

void setEmojiReplaceStrategy(int replaceStrategy)

Sets whether to replace all emoji with EmojiSpans.

Inherited methods

XML attributes

EmojiExtractTextLayout_emojiReplaceStrategy

Related methods:

Public constructors

EmojiExtractTextLayout

added in version 1.0.0
public EmojiExtractTextLayout (Context context)

Parameters
context Context

EmojiExtractTextLayout

added in version 1.0.0
public EmojiExtractTextLayout (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

EmojiExtractTextLayout

added in version 1.0.0
public EmojiExtractTextLayout (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

EmojiExtractTextLayout

added in version 1.0.0
public EmojiExtractTextLayout (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

getEmojiReplaceStrategy

added in version 1.0.0
public int getEmojiReplaceStrategy ()

Returns whether to replace all emoji with EmojiSpans. Default value is EmojiCompat.REPLACE_STRATEGY_DEFAULT.

Related XML Attributes:

Returns
int one of EmojiCompat.REPLACE_STRATEGY_DEFAULT, EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, EmojiCompat.REPLACE_STRATEGY_ALL

onUpdateExtractingViews

added in version 1.0.0
public void onUpdateExtractingViews (InputMethodService inputMethodService, 
                EditorInfo ei)

Initializes the layout. Call this function from InputMethodService#onUpdateExtractingViews(EditorInfo).

Parameters
inputMethodService InputMethodService

ei EditorInfo

setEmojiReplaceStrategy

added in version 1.0.0
public void setEmojiReplaceStrategy (int replaceStrategy)

Sets whether to replace all emoji with EmojiSpans. Default value is EmojiCompat.REPLACE_STRATEGY_DEFAULT.

Related XML Attributes:

Parameters
replaceStrategy int: should be one of EmojiCompat.REPLACE_STRATEGY_DEFAULT, EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, EmojiCompat.REPLACE_STRATEGY_ALL