diff --git a/bezier/src/main/AndroidManifest.xml b/bezier/src/main/AndroidManifest.xml index 8bdb7e14..17a1ce20 100644 --- a/bezier/src/main/AndroidManifest.xml +++ b/bezier/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + diff --git a/bezier/src/main/java/io/channel/bezier/extension/EmojiExtensions.kt b/bezier/src/main/java/io/channel/bezier/extension/EmojiExtensions.kt new file mode 100644 index 00000000..f8a65d18 --- /dev/null +++ b/bezier/src/main/java/io/channel/bezier/extension/EmojiExtensions.kt @@ -0,0 +1,12 @@ +package io.channel.bezier.extension + +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.painter.Painter +import coil.compose.rememberAsyncImagePainter +import java.net.URLEncoder + +private const val emojiUrl = "https://cf.channel.io/asset/emoji/images/80/%s.png" + +internal val String.toEmojiPainter: Painter + @Composable + get() = rememberAsyncImagePainter(model = emojiUrl.format(URLEncoder.encode(this, "UTF-8")))