The Android Developer Challenge is back! Submit your idea before December 2.

EmojiExtractTextLayout

open class EmojiExtractTextLayout : LinearLayout
kotlin.Any
   ↳ 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);
      }
  }
  
androidx.emoji.R.attr#emojiReplaceStrategy

Summary

Public constructors

<init>(context: Context!)

<init>(context: Context!, @Nullable attrs: AttributeSet?)

<init>(context: Context!, @Nullable attrs: AttributeSet?, defStyleAttr: Int)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods

open Int

Returns whether to replace all emoji with EmojiSpans.

open Unit

Initializes the layout.

open Unit
setEmojiReplaceStrategy(replaceStrategy: Int)

Sets whether to replace all emoji with EmojiSpans.

Public constructors

<init>

EmojiExtractTextLayout(context: Context!)

<init>

EmojiExtractTextLayout(context: Context!, @Nullable attrs: AttributeSet?)

<init>

EmojiExtractTextLayout(context: Context!, @Nullable attrs: AttributeSet?, defStyleAttr: Int)

<init>

EmojiExtractTextLayout(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods

getEmojiReplaceStrategy

open fun getEmojiReplaceStrategy(): Int

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

Return
Int: one of EmojiCompat#REPLACE_STRATEGY_DEFAULT, EmojiCompat#REPLACE_STRATEGY_NON_EXISTENT, EmojiCompat#REPLACE_STRATEGY_ALL androidx.emoji.R.attr#emojiReplaceStrategy

onUpdateExtractingViews

open fun onUpdateExtractingViews(inputMethodService: InputMethodService!, ei: EditorInfo!): Unit

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

setEmojiReplaceStrategy

open fun setEmojiReplaceStrategy(replaceStrategy: Int): Unit

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

Parameters
replaceStrategy Int: should be one of EmojiCompat#REPLACE_STRATEGY_DEFAULT, EmojiCompat#REPLACE_STRATEGY_NON_EXISTENT, EmojiCompat#REPLACE_STRATEGY_ALL androidx.emoji.R.attr#emojiReplaceStrategy