# BundledEmojiCompatConfig

Artifact: [androidx.emoji2:emoji2-bundled](https://developer.android.com/jetpack/androidx/releases/emoji2) [View Source](https://cs.android.com/search?q=file:androidx/emoji2/bundled/BundledEmojiCompatConfig.java+class:androidx.emoji2.bundled.BundledEmojiCompatConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

*** ** * ** ***


```
public class BundledEmojiCompatConfig extends EmojiCompat.Config
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.emoji2.text.EmojiCompat.Config](https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config) ||
|   | ↳ | [androidx.emoji2.bundled.BundledEmojiCompatConfig](https://developer.android.com/reference/androidx/emoji2/bundled/BundledEmojiCompatConfig) |

*** ** * ** ***

`https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` implementation that loads the metadata using AssetManager and bundled resources.

```
EmojiCompat.init(new BundledEmojiCompatConfig(context));
```
Including the emoji2-bundled artifact disables the `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompatInitializer`. You must manually call EmojiCompat.init when using the bundled configuration.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat` |   |

## Summary

| ### Public constructors |
|---|
| `[BundledEmojiCompatConfig](https://developer.android.com/reference/androidx/emoji2/bundled/BundledEmojiCompatConfig#BundledEmojiCompatConfig(android.content.Context))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` **This method is deprecated.** please call BundledEmojiCompatConfig(context, executor) to control the font loading thread. <br /> |
| `https://developer.android.com/reference/androidx/emoji2/bundled/BundledEmojiCompatConfig#BundledEmojiCompatConfig(android.content.Context,java.util.concurrent.Executor)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html fontLoadExecutor )` Controls the executor font is loaded on. |

### Inherited methods

From [androidx.emoji2.text.EmojiCompat.Config](https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config) `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.MetadataRepoLoader` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#getMetadataRepoLoader()()`

Returns the `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.MetadataRepoLoader`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.InitCallback initCallback)`

Registers an initialization callback.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#registerInitCallback(java.util.concurrent.Executor,androidx.emoji2.text.EmojiCompat.InitCallback)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html executor,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.InitCallback initCallback
)`

Registers an initialization callback.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setEmojiSpanIndicatorColor(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)`

Sets the color used as emoji span indicator.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setEmojiSpanIndicatorEnabled(boolean)(boolean emojiSpanIndicatorEnabled)`

Determines whether a background will be drawn for the emojis that are found and replaced by EmojiCompat.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setGlyphChecker(androidx.emoji2.text.EmojiCompat.GlyphChecker)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.GlyphChecker glyphChecker)`

The interface that is used by EmojiCompat in order to check if a given emoji can be rendered by the system.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setMetadataLoadStrategy(int)(int strategy)`

Determines the strategy to start loading the metadata.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setReplaceAll(boolean)(boolean replaceAll)`

Determines whether EmojiCompat should replace all the emojis it finds with the EmojiSpans.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setSpanFactory(androidx.emoji2.text.EmojiCompat.SpanFactory)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.SpanFactory factory)`

Set the span factory used to actually draw emoji replacements.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setUseAfterUpdatableSystemFonts(boolean)(boolean useAfter)`

Configure whether EmojiCompat should continue to process emojis and load metadata on devices that support Updatable System Fonts (API 35 and above).
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean)(boolean useEmojiAsDefaultStyle)`

Determines whether EmojiCompat should use the emoji presentation style for emojis that have text style as default.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean,java.util.List<java.lang.Integer>)(
boolean useEmojiAsDefaultStyle,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/Integer.html> emojiAsDefaultStyleExceptions
)` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config` `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.Config#unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat.InitCallback initCallback)`

Unregisters a callback that was added before.

## Public constructors

### BundledEmojiCompatConfig

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.5.0)

```
public [BundledEmojiCompatConfig](https://developer.android.com/reference/androidx/emoji2/bundled/BundledEmojiCompatConfig#BundledEmojiCompatConfig(android.content.Context))(@NonNull Context context)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> please call BundledEmojiCompatConfig(context, executor) to control the font loading thread. This constructor will spin up a new temporary thread.

Font will be loaded on a new temporary Thread.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | Context instance |

### BundledEmojiCompatConfig

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.5.0)

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

Controls the executor font is loaded on.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | Context instance |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html fontLoadExecutor` | Executor to load font on |