Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

FontRequestEmojiCompatConfig

public class FontRequestEmojiCompatConfig
extends EmojiCompat.Config

java.lang.Object
   ↳ androidx.emoji.text.EmojiCompat.Config
     ↳ androidx.emoji.text.FontRequestEmojiCompatConfig


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 classes

class FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy

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

class FontRequestEmojiCompatConfig.RetryPolicy

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

Public constructors

FontRequestEmojiCompatConfig(Context context, FontRequest request)

Public methods

FontRequestEmojiCompatConfig setHandler(Handler handler)

Sets the custom handler to be used for initialization.

FontRequestEmojiCompatConfig setRetryPolicy(FontRequestEmojiCompatConfig.RetryPolicy policy)

Sets the retry policy.

Inherited methods

Public constructors

FontRequestEmojiCompatConfig

public FontRequestEmojiCompatConfig (Context context, 
                FontRequest request)

Parameters
context Context: Context instance, cannot be null

request FontRequest: FontRequest to fetch the font asynchronously, cannot be null

Public methods

setHandler

public FontRequestEmojiCompatConfig setHandler (Handler handler)

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.

Returns
FontRequestEmojiCompatConfig

setRetryPolicy

public FontRequestEmojiCompatConfig setRetryPolicy (FontRequestEmojiCompatConfig.RetryPolicy policy)

Sets the retry policy.

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.

Returns
FontRequestEmojiCompatConfig