Emojis Keyboard integration in Android apps

Tram Ho

Emoticons are a great way to express emotions and convey thoughts between us, that people of different languages ​​can understand, even children.

This article guides you how to easily integrate emojis into the application, with many customizations using the SuperNova-Emoji library .

1. Simple integration

Here is the integrated syntax for Emojis Keyboard. EmojiIconActionsconstructor passes four parameters: Context, RootView, EmojiconEditText and ImageView.

Usually, passing the RootView original layout is the best option to display the Emojis Keyboard in all views.

EmojiconEditText a EditText with custom properties to allow the display more emoticons. And the last parameter ImageView will be used to switch between the regular keyboard and the emoji keyboard.

To display emojis in TextView , we will use EmojiconTextView . This is also a TextView with more customizable properties to enable emoji display

If you want to use in layout xml, use normal EditText EmojiconEditText instead.

And use EmojiconTextView instead of TextView :

2. Change the default conversion icon

To switch between regular keyboard and emoji keyboard, you can call setIconsIds () method with two parameters: keyboard Icon ID and smiley Icon ID.

3.Use the device’s default Emoji

SuperNove-Emoji allows you to use emojis on your device in a simple way. You need to set the boolean value of the setUseSystemEmoji () and setUseSystemDefault ( ) methods to TRUE in every EmojiconTextView and EmojiconEditText that you use to display emojis.

Share the news now

Source : Viblo