class EmojiExtractTextLayout extends LinearLayout {

    public void onUpdateExtractingViews(InputMethodService inputMethodService, EditorInfo ei) {
        // the following code is ported as it is from InputMethodService.onUpdateExtractingViews
        if (!inputMethodService.isExtractViewShown()) {
            return;
        }

        if (mExtractAccessories == null) {
            return;
        }

        final boolean hasAction = ei.actionLabel != null
                || ((ei.imeOptions & EditorInfo.IME_MASK_ACTION) != EditorInfo.IME_ACTION_NONE
                && (ei.imeOptions & EditorInfo.IME_FLAG_NO_ACCESSORY_ACTION) == 0
                && ei.inputType != InputType.TYPE_NULL);

        if (hasAction) {
            mExtractAccessories.setVisibility(View.VISIBLE);
            if (mExtractAction != null) {
                if (ei.actionLabel != null) {
                    mExtractAction.setText(ei.actionLabel);
                } else {
                    mExtractAction.setText(inputMethodService.getTextForImeAction(ei.imeOptions));
                }
                mExtractAction.setOnClickListener(getButtonClickListener(inputMethodService));
            }
        } else {
            mExtractAccessories.setVisibility(View.GONE);
            if (mExtractAction != null) {
                mExtractAction.setOnClickListener(null);
            }
        }
    }

    public  EmojiExtractTextLayout(Context context);
    public  EmojiExtractTextLayout(Context context,
            @Nullable AttributeSet attrs);
    public  EmojiExtractTextLayout(Context context,
            @Nullable AttributeSet attrs, int defStyleAttr);
    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public  EmojiExtractTextLayout(Context context, AttributeSet attrs,
            int defStyleAttr, int defStyleRes);

}