BundledEmojiCompatConfig


public class BundledEmojiCompatConfig extends EmojiCompat.Config


EmojiCompat.Config implementation that loads the metadata using AssetManager and bundled resources.

EmojiCompat.init(new BundledEmojiCompatConfig(context));
Including the emoji2-bundled artifact disables the androidx.emoji2.text.EmojiCompatInitializer. You must manually call EmojiCompat.init when using the bundled configuration.
See also
EmojiCompat

Summary

Public constructors

This method is deprecated.

please call BundledEmojiCompatConfig(context, executor) to control the font loading thread.

BundledEmojiCompatConfig(
    @NonNull Context context,
    @NonNull Executor fontLoadExecutor
)

Controls the executor font is loaded on.

Inherited methods

From androidx.emoji2.text.EmojiCompat.Config
final @NonNull EmojiCompat.MetadataRepoLoader

Returns the MetadataRepoLoader.

@NonNull EmojiCompat.Config

Registers an initialization callback.

@NonNull EmojiCompat.Config
registerInitCallback(
    @NonNull Executor executor,
    @NonNull EmojiCompat.InitCallback initCallback
)

Registers an initialization callback.

@NonNull EmojiCompat.Config

Sets the color used as emoji span indicator.

@NonNull EmojiCompat.Config
setEmojiSpanIndicatorEnabled(boolean emojiSpanIndicatorEnabled)

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

@NonNull EmojiCompat.Config

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

@NonNull EmojiCompat.Config

Determines the strategy to start loading the metadata.

@NonNull EmojiCompat.Config
setReplaceAll(boolean replaceAll)

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

@NonNull EmojiCompat.Config

Set the span factory used to actually draw emoji replacements.

@NonNull EmojiCompat.Config
setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle)

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

@NonNull EmojiCompat.Config
setUseEmojiAsDefaultStyle(
    boolean useEmojiAsDefaultStyle,
    @Nullable List<Integer> emojiAsDefaultStyleExceptions
)
@NonNull EmojiCompat.Config

Unregisters a callback that was added before.

Public constructors

BundledEmojiCompatConfig

Added in 1.0.0
Deprecated in 1.5.0
public BundledEmojiCompatConfig(@NonNull Context context)

Font will be loaded on a new temporary Thread.

Parameters
@NonNull Context context

Context instance

BundledEmojiCompatConfig

Added in 1.5.0
public BundledEmojiCompatConfig(
    @NonNull Context context,
    @NonNull Executor fontLoadExecutor
)

Controls the executor font is loaded on.

Parameters
@NonNull Context context

Context instance

@NonNull Executor fontLoadExecutor

Executor to load font on