EmojiSpan


public abstract class EmojiSpan extends ReplacementSpan


Base span class for the emoji replacement. When an emoji is found and needs to be replaced in a CharSequence, an instance of this class is added to the CharSequence.

Summary

Public methods

int
getSize(
    @NonNull Paint paint,
    CharSequence text,
    int start,
    int end,
    @Nullable Paint.FontMetricsInt fm
)
final @NonNull TypefaceEmojiRasterizer

Get the rasterizer that draws this emoji.

Inherited methods

From android.text.style.CharacterStyle
From android.text.style.MetricAffectingSpan
From android.text.style.ReplacementSpan
abstract void
draw(
    Canvas p,
    CharSequence p1,
    int p2,
    int p3,
    float p4,
    int p5,
    int p6,
    int p7,
    Paint p8
)
CharSequence
void
setContentDescription(CharSequence contentDescription)
void
void

Public methods

getSize

Added in 1.0.0
public int getSize(
    @NonNull Paint paint,
    CharSequence text,
    int start,
    int end,
    @Nullable Paint.FontMetricsInt fm
)

getTypefaceRasterizer

Added in 1.3.0
public final @NonNull TypefaceEmojiRasterizer getTypefaceRasterizer()

Get the rasterizer that draws this emoji.

Returns
@NonNull TypefaceEmojiRasterizer

rasterizer to draw emoji