# EmojiCompat.Config

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-emoji:28.0.0-alpha1  
Summary:[Protected Ctors](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#proctors)\|[Methods](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#)  

# EmojiCompat.Config

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static

abstract
class
EmojiCompat.Config
`  
`

extends Object


``


`

|---|-----------------------------------------------|
| java.lang.Object                                 ||
| ↳ | android.support.text.emoji.EmojiCompat.Config |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#)Known Direct Subclasses [BundledEmojiCompatConfig](https://developer.android.com/reference/android/support/text/emoji/bundled/BundledEmojiCompatConfig),[FontRequestEmojiCompatConfig](https://developer.android.com/reference/android/support/text/emoji/FontRequestEmojiCompatConfig) |---------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [BundledEmojiCompatConfig](https://developer.android.com/reference/android/support/text/emoji/bundled/BundledEmojiCompatConfig) | [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config)implementation that loads the metadata using AssetManager and bundled resources.                                                                                                     | | [FontRequestEmojiCompatConfig](https://developer.android.com/reference/android/support/text/emoji/FontRequestEmojiCompatConfig) | [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config)implementation that asynchronously fetches the required font and the metadata using a[FontRequest](https://developer.android.com/reference/android/support/v4/provider/FontRequest). | |

<br />

*** ** * ** ***

Configuration class for EmojiCompat. Changes to the values will be ignored after[init(Config)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat#init(android.support.text.emoji.EmojiCompat.Config))is called.  
**See also:**

- [init(EmojiCompat.Config)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat#init(android.support.text.emoji.EmojiCompat.Config))

## Summary

|                                                                                                                                                                          ### Protected constructors                                                                                                                                                                           ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#EmojiCompat.Config(android.support.text.emoji.EmojiCompat.MetadataRepoLoader))`(`[EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader)` metadataLoader) ` Default constructor. |

|                                                                                                                                                                                                                                           ### Public methods                                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[registerInitCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#registerInitCallback(android.support.text.emoji.EmojiCompat.InitCallback))`(`[EmojiCompat.InitCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.InitCallback)` initCallback) ` Registers an initialization callback.             |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[setEmojiSpanIndicatorColor](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setEmojiSpanIndicatorColor(int))`(int color) ` Sets the color used as emoji span indicator.                                                                                                                                                                       |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[setEmojiSpanIndicatorEnabled](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setEmojiSpanIndicatorEnabled(boolean))`(boolean emojiSpanIndicatorEnabled) ` Determines whether a background will be drawn for the emojis that are found and replaced by EmojiCompat.                                                                           |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[setReplaceAll](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setReplaceAll(boolean))`(boolean replaceAll) ` Determines whether EmojiCompat should replace all the emojis it finds with the EmojiSpans.                                                                                                                                      |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[setUseEmojiAsDefaultStyle](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean))`(boolean useEmojiAsDefaultStyle) ` Determines whether EmojiCompat should use the emoji presentation style for emojis that have text style as default.                                                                          |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[setUseEmojiAsDefaultStyle](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean, java.util.List<java.lang.Integer>))`(boolean useEmojiAsDefaultStyle, List<Integer> emojiAsDefaultStyleExceptions) `                                                                                                             |
| ` `[EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | ` `[unregisterInitCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#unregisterInitCallback(android.support.text.emoji.EmojiCompat.InitCallback))`(`[EmojiCompat.InitCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.InitCallback)` initCallback) ` Unregisters a callback that was added before. |

|                                                                                                                                                                                                            ### Protected methods                                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final `[EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader) | ` `[getMetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#getMetadataRepoLoader())`() ` Returns the[EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader). |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Protected constructors

### EmojiCompat.Config

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config (EmojiCompat.MetadataRepoLoader metadataLoader)
```

Default constructor.

<br />

|                                               Parameters                                                ||
|------------------|---------------------------------------------------------------------------------------|
| `metadataLoader` | `EmojiCompat.MetadataRepoLoader`: MetadataRepoLoader instance, cannot be`null` <br /> |

## Public methods

### registerInitCallback

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config registerInitCallback (EmojiCompat.InitCallback initCallback)
```

Registers an initialization callback.

<br />

|                                                 Parameters                                                  ||
|----------------|---------------------------------------------------------------------------------------------|
| `initCallback` | `EmojiCompat.InitCallback`: the initialization callback to register, cannot be`null` <br /> |

|                                                                     Returns                                                                     ||
|-------------------------------------------------------------------------------------------------------------|------------------------------------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | EmojiCompat.Config instance <br /> |

### setEmojiSpanIndicatorColor

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config setEmojiSpanIndicatorColor (int color)
```

Sets the color used as emoji span indicator. The default value is[Color.GREEN](https://developer.android.com/reference/android/graphics/Color.html#GREEN).

<br />

|      Parameters       ||
|---------|--------------|
| `color` | `int` <br /> |

|                                                       Returns                                                       ||
|-------------------------------------------------------------------------------------------------------------|--------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | <br /> |

**See also:**

- [setEmojiSpanIndicatorEnabled(boolean)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setEmojiSpanIndicatorEnabled(boolean))  

### setEmojiSpanIndicatorEnabled

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config setEmojiSpanIndicatorEnabled (boolean emojiSpanIndicatorEnabled)
```

Determines whether a background will be drawn for the emojis that are found and replaced by EmojiCompat. Should be used only for debugging purposes. The indicator color can be set using[setEmojiSpanIndicatorColor(int)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setEmojiSpanIndicatorColor(int)).

<br />

|                                                   Parameters                                                   ||
|-----------------------------|-----------------------------------------------------------------------------------|
| `emojiSpanIndicatorEnabled` | `boolean`: when`true`a background is drawn for each emoji that is replaced <br /> |

|                                                       Returns                                                       ||
|-------------------------------------------------------------------------------------------------------------|--------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | <br /> |

### setReplaceAll

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config setReplaceAll (boolean replaceAll)
```

Determines whether EmojiCompat should replace all the emojis it finds with the EmojiSpans. By default EmojiCompat tries its best to understand if the system already can render an emoji and do not replace those emojis.

<br />

|                                Parameters                                ||
|--------------|------------------------------------------------------------|
| `replaceAll` | `boolean`: replace all emojis found with EmojiSpans <br /> |

|                                                                     Returns                                                                     ||
|-------------------------------------------------------------------------------------------------------------|------------------------------------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | EmojiCompat.Config instance <br /> |

### setUseEmojiAsDefaultStyle

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config setUseEmojiAsDefaultStyle (boolean useEmojiAsDefaultStyle)
```

Determines whether EmojiCompat should use the emoji presentation style for emojis that have text style as default. By default, the text style would be used, unless these are followed by the U+FE0F variation selector. Details about emoji presentation and text presentation styles can be found here: http://unicode.org/reports/tr51/#Presentation_Style If useEmojiAsDefaultStyle is true, the emoji presentation style will be used for all emojis, including potentially unexpected ones (such as digits or other keycap emojis). If this is not the expected behaviour, method[setUseEmojiAsDefaultStyle(boolean, List)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean, java.util.List<java.lang.Integer>))can be used to specify the exception emojis that should be still presented as text style.

<br />

|                                                                       Parameters                                                                        ||
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `useEmojiAsDefaultStyle` | `boolean`: whether to use the emoji style presentation for all emojis that would be presented as text style by default <br /> |

|                                                       Returns                                                       ||
|-------------------------------------------------------------------------------------------------------------|--------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | <br /> |

### setUseEmojiAsDefaultStyle

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config setUseEmojiAsDefaultStyle (boolean useEmojiAsDefaultStyle, 
                List<Integer> emojiAsDefaultStyleExceptions)
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                Parameters                                                                                                                                                                                                                                                                                                                                ||
|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `useEmojiAsDefaultStyle`        | `boolean` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `emojiAsDefaultStyleExceptions` | `List`: Contains the exception emojis which will be still presented as text style even if the useEmojiAsDefaultStyle flag is set to`true`. This list will be ignored if useEmojiAsDefaultStyle is`false`. Note that emojis with default emoji style presentation will remain emoji style regardless the value of useEmojiAsDefaultStyle or whether they are included in the exceptions list or not. When no exception is wanted, the method[setUseEmojiAsDefaultStyle(boolean)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean))should be used instead. <br /> |

|                                                       Returns                                                       ||
|-------------------------------------------------------------------------------------------------------------|--------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | <br /> |

**See also:**

- [setUseEmojiAsDefaultStyle(boolean)](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config#setUseEmojiAsDefaultStyle(boolean))  

### unregisterInitCallback

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.Config unregisterInitCallback (EmojiCompat.InitCallback initCallback)
```

Unregisters a callback that was added before.

<br />

|                                                  Parameters                                                   ||
|----------------|-----------------------------------------------------------------------------------------------|
| `initCallback` | `EmojiCompat.InitCallback`: the initialization callback to be removed, cannot be`null` <br /> |

|                                                                     Returns                                                                     ||
|-------------------------------------------------------------------------------------------------------------|------------------------------------|
| [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config) | EmojiCompat.Config instance <br /> |

## Protected methods

### getMetadataRepoLoader

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EmojiCompat.MetadataRepoLoader getMetadataRepoLoader ()
```

Returns the[EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader).

<br />

|                                                                   Returns                                                                   ||
|-------------------------------------------------------------------------------------------------------------------------------------|--------|
| [EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader) | <br /> |

-

  ## Interfaces

  - [EmojiCompat.MetadataRepoLoader](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader)
-

  ## Classes

  - [EmojiCompat](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat)
  - [EmojiCompat.Config](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.Config)
  - [EmojiCompat.InitCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.InitCallback)
  - [EmojiCompat.MetadataRepoLoaderCallback](https://developer.android.com/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoaderCallback)
  - [EmojiSpan](https://developer.android.com/reference/android/support/text/emoji/EmojiSpan)
  - [FontRequestEmojiCompatConfig](https://developer.android.com/reference/android/support/text/emoji/FontRequestEmojiCompatConfig)
  - [FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy](https://developer.android.com/reference/android/support/text/emoji/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy)
  - [FontRequestEmojiCompatConfig.RetryPolicy](https://developer.android.com/reference/android/support/text/emoji/FontRequestEmojiCompatConfig.RetryPolicy)
  - [MetadataRepo](https://developer.android.com/reference/android/support/text/emoji/MetadataRepo)
  - [R](https://developer.android.com/reference/android/support/text/emoji/R)
  - [R.attr](https://developer.android.com/reference/android/support/text/emoji/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/text/emoji/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/text/emoji/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/text/emoji/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/text/emoji/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/text/emoji/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/text/emoji/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/text/emoji/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/text/emoji/R.string)
  - [R.style](https://developer.android.com/reference/android/support/text/emoji/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/text/emoji/R.styleable)