Add EmojiCompat

This commit is contained in:
Mygod
2019-01-31 20:40:24 +08:00
parent 5999ab66d1
commit 08ab6a54ff
7 changed files with 69 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
package be.mygod.vpnhotspot.client
import androidx.emoji.text.EmojiCompat
import java.lang.IllegalStateException
fun emojize(text: CharSequence?): CharSequence? = if (text == null) null else try {
EmojiCompat.get().process(text)
} catch (_: IllegalStateException) {
text
}