From d49d46ba53e12df67f56c7f77f926613edb939f4 Mon Sep 17 00:00:00 2001 From: Salomon BRYS Date: Sun, 31 Mar 2024 11:46:12 +0200 Subject: [PATCH] Service initialization doc --- Readme.adoc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Readme.adoc b/Readme.adoc index b2c4b52..7ce6c81 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -193,6 +193,21 @@ It is needed if any of the following is true: ==== +=== Initializing the Emoji Service + +The first time you use emoji composable functions, the emoji service will need to initialise, which may take a few milliseconds. +You can initialise the emoji service ahead of time si that even the first emoji composable function invocation will be instantaneous: + +[source,kotlin] +---- +@Composable +fun App() { + remember { EmojiService.initialize() } //<1> + AppContent() +} +---- +<1> Service initialization happens in the background and will *not* block the UI thread. + === Displaying Emoji with Noto vector images You can display an Emoji Image with `NotoImageEmoji`: @@ -292,7 +307,7 @@ WithNotoImageEmoji( <2> inlineContent: `Map` -=== Accessing & customizing the Emoji Service +=== Customizing the Emoji Service The `EmojiService` is the global reference to the `EmojiFinder` and `EmojiTemplateCatalog` used by this library. + You can access it with: