MetadataRepo

@AnyThread
@RequiresApi(value = 19)
public final class MetadataRepo


Class to hold the emoji metadata required to process and draw emojis.

Summary

Public methods

static @NonNull MetadataRepo
create(@NonNull AssetManager assetManager, @NonNull String assetPath)

Construct MetadataRepo from an asset.

static @NonNull MetadataRepo
create(@NonNull Typeface typeface, @NonNull ByteBuffer byteBuffer)

Construct MetadataRepo from a byte buffer.

static @NonNull MetadataRepo
create(@NonNull Typeface typeface, @NonNull InputStream inputStream)

Construct MetadataRepo from an input stream.

Public methods

create

Added in 1.0.0
public static @NonNull MetadataRepo create(@NonNull AssetManager assetManager, @NonNull String assetPath)

Construct MetadataRepo from an asset.

Parameters
@NonNull AssetManager assetManager

AssetManager instance

@NonNull String assetPath

asset manager path of the file that the Typeface and metadata will be created from

create

Added in 1.0.0
public static @NonNull MetadataRepo create(@NonNull Typeface typeface, @NonNull ByteBuffer byteBuffer)

Construct MetadataRepo from a byte buffer. The position of the ByteBuffer will change, it is caller's responsibility to reposition the buffer if required.

Parameters
@NonNull Typeface typeface

Typeface to be used to render emojis

@NonNull ByteBuffer byteBuffer

ByteBuffer to read emoji metadata from

create

Added in 1.0.0
public static @NonNull MetadataRepo create(@NonNull Typeface typeface, @NonNull InputStream inputStream)

Construct MetadataRepo from an input stream. The library does not close the given InputStream, therefore it is caller's responsibility to properly close the stream.

Parameters
@NonNull Typeface typeface

Typeface to be used to render emojis

@NonNull InputStream inputStream

InputStream to read emoji metadata from