https://github.com/chinalwb/simpleemojipicker
Quick simple emoji picker
https://github.com/chinalwb/simpleemojipicker
emoji-keyboard emoji-picker
Last synced: about 13 hours ago
JSON representation
Quick simple emoji picker
- Host: GitHub
- URL: https://github.com/chinalwb/simpleemojipicker
- Owner: chinalwb
- License: apache-2.0
- Created: 2018-03-21T16:14:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T16:44:27.000Z (over 7 years ago)
- Last Synced: 2025-03-30T19:37:12.961Z (6 months ago)
- Topics: emoji-keyboard, emoji-picker
- Language: Java
- Size: 628 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleEmojiPicker
Just a quick simple emoji picker, it helps you to setup your emoji picker app quickly.It allows you to define a set of emoji groups, includes the emoji icons / emoji icon size / columns / click listeners. And pretty easy and lightweight to integrate into your apps.
## Screenshots
### One the emoji groups

### Another one of the emoji groups
## How to use?
0. Import the library to your project. The lib is inside the `EmojiSample` folder at here [emojipanel](https://github.com/chinalwb/SimpleEmojiPicker/tree/master/EmojiSample/emojipanel)1. Add an emoji container to your layout file, your emoji panel will be shown inside:
```
```2. In your java file, init an instance of `EmojiPanel` like this:
```
private void initEmojiPanel() {
// mContext = YOUR_ACTIVITY
EmojiPanel emojiPanel = new EmojiPanel(mContext);
emojiPanel.setId(R.id.emojiPanelId);
FragmentManager fragmentManager = ((AppCompatActivity) mContext).getSupportFragmentManager();
ArrayList emojiGroups = initEmojiGroups();
EmojiPagerAdapter adapter = new EmojiPagerAdapter(mContext, emojiGroups, fragmentManager);
emojiPanel.setAdapter(adapter);
}
```3. You may have noticed the `initEmojiGroups`, it is as below:
```
private ArrayList initEmojiGroups() {
// I just didn't paste group1 and 2 here...
EmojiGroup group3 = new EmojiGroup();
EmojiGroupDesc desc3 = new EmojiGroupDesc();
desc3.numColumns = 4; // The columns count
desc3.size = 90; // The size of each emoji, in dp
int[] imageResIds3 = { // The emoji icons to be shown for this group
R.drawable.wx_d_1,
R.drawable.wx_d_2,
R.drawable.wx_d_3,
};
desc3.imageResIds = imageResIds3;
group3.listener = listenerC;
group3.desc = desc3;ArrayList groups = new ArrayList<>();
groups.add(group3);
return groups;
}
```4. So what is `listenerC`?
```
private AdapterView.OnItemClickListener listenerC = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
int resId = ((EmojiGridViewAdapter.ViewHolder) view.getTag()).resId;
insertEmoji(resId);
}
};
```That's it!
## To summary:
With this library you can define a set of emoji groups, each group will be shown at a fragment, all groups will be shown within a ViewPager (`EmojiPanel` extends ViewPager). You can set different click listener to each emoji group, such as append the emoji to EditText or show it in a PopupWindow.BTW, in the sample app, I added the feature about toggling between emoji panel and keyboard, which I think will be useful in most cases.
### Todos
* Add emoji group indicator
* Add Gradle supportAny advice will be appreaciate. Enjoy playing with Simple Emoijipicker.