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 MetadataRepo
create(@NonNull AssetManager assetManager, String assetPath)

Construct MetadataRepo from an asset.

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

Construct MetadataRepo from a byte buffer.

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

Construct MetadataRepo from an input stream.

Public methods

create

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

Construct MetadataRepo from an asset.

Parameters
@NonNull AssetManager assetManager

AssetManager instance

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 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 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