Add EmojiCompat
This commit is contained in:
10
mobile/src/main/java/be/mygod/vpnhotspot/client/Emojize.kt
Normal file
10
mobile/src/main/java/be/mygod/vpnhotspot/client/Emojize.kt
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user