FontRequestEmojiCompatConfig

class FontRequestEmojiCompatConfig : EmojiCompat.Config


EmojiCompat.Config implementation that asynchronously fetches the required font and the metadata using a FontRequest. FontRequest should be constructed to fetch an EmojiCompat compatible emoji font.

Summary

Nested types

A retry policy implementation that doubles the amount of time in between retries.

Retry policy used when the font provider is not ready to give the font file.

Public constructors

Public functions

FontRequestEmojiCompatConfig!
setHandler(handler: Handler!)

Sets the custom handler to be used for initialization.

FontRequestEmojiCompatConfig!

Sets the retry policy.

Inherited functions

From androidx.emoji.text.EmojiCompat.Config
EmojiCompat.MetadataRepoLoader!

Returns the MetadataRepoLoader.

EmojiCompat.Config!

Registers an initialization callback.

EmojiCompat.Config!

Sets the color used as emoji span indicator.

EmojiCompat.Config!
setEmojiSpanIndicatorEnabled(emojiSpanIndicatorEnabled: Boolean)

Determines whether a background will be drawn for the emojis that are found and replaced by EmojiCompat.

EmojiCompat.Config

The interface that is used by EmojiCompat in order to check if a given emoji can be rendered by the system.

EmojiCompat.Config!

Determines the strategy to start loading the metadata.

EmojiCompat.Config!
setReplaceAll(replaceAll: Boolean)

Determines whether EmojiCompat should replace all the emojis it finds with the EmojiSpans.

EmojiCompat.Config!
setUseEmojiAsDefaultStyle(useEmojiAsDefaultStyle: Boolean)

Determines whether EmojiCompat should use the emoji presentation style for emojis that have text style as default.

EmojiCompat.Config!
setUseEmojiAsDefaultStyle(
    useEmojiAsDefaultStyle: Boolean,
    emojiAsDefaultStyleExceptions: (Mutable)List<Int!>?
)
EmojiCompat.Config!

Unregisters a callback that was added before.

Public constructors

FontRequestEmojiCompatConfig

Added in 1.0.0
FontRequestEmojiCompatConfig(context: Context, request: FontRequest)
Parameters
context: Context

Context instance, cannot be null

request: FontRequest

FontRequest to fetch the font asynchronously, cannot be null

Public functions

setHandler

Added in 1.0.0
fun setHandler(handler: Handler!): FontRequestEmojiCompatConfig!

Sets the custom handler to be used for initialization. Since font fetch take longer time, the metadata loader will fetch the fonts on the background thread. You can pass your own handler for this background fetching. This handler is also used for retrying.

Parameters
handler: Handler!

A Handler to be used for initialization. Can be null. In case of null, the metadata loader creates own HandlerThread for initialization.

setRetryPolicy

Added in 1.0.0
fun setRetryPolicy(policy: FontRequestEmojiCompatConfig.RetryPolicy!): FontRequestEmojiCompatConfig!

Sets the retry policy. {@see RetryPolicy}

Parameters
policy: FontRequestEmojiCompatConfig.RetryPolicy!

The policy to be used when the font provider is not ready to give the font file. Can be null. In case of null, the metadata loader never retries.