vanniktech / emoji Goto Github PK
View Code? Open in Web Editor NEWA library to add Emoji support to your Android / JVM Application
License: Apache License 2.0
A library to add Emoji support to your Android / JVM Application
License: Apache License 2.0
First of all thank you very much for your work @rubengees in #77.
There are a few things that I still want to talk about and hence a new issue since that PR is already way too long to get an overview about things.
destroy
method be called of the EmojiManager?Some more stuff might get added to the list as we tackle it down.
i got an emoji library from here https://github.com/vanniktech/Emoji
i am trying to add emoji library to my android project but when i compile below line it gives me error which is shown in screen shot.
if anyone use this library and getting same then please help.
Thanks in advance.
compile 'com.vanniktech:emoji:0.4.0'
compile 'com.vanniktech:emoji:0.4.0-SNAPSHOT
my android studio version is 2.1.2
Whenever i open the emoticons with button and change to keybord and hide it (call method dismiss();) i lost focus to rootView so then i can open emoticonsSelect but i no have a the rootView
This open:
private void showEmoticon() {
imageEmoticonButton.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
emojiPopup.toggle();
}
});
}
i setup on OnCreateView (fragment)
private void setUpEmojiPopup() {
emojiPopup = EmojiPopup.Builder.fromRootView(sendPanel).setOnEmojiBackspaceClickListener(new OnEmojiBackspaceClickListener() {
@OverRide
public void onEmojiBackspaceClicked(final View v) {
}
}).setOnEmojiClickedListener(new OnEmojiClickedListener() {
@OverRide
public void onEmojiClicked(final Emoji emoji) {
}
}).setOnEmojiPopupShownListener(new OnEmojiPopupShownListener() {
@OverRide
public void onEmojiPopupShown() {
// imageEmoticonButton.setEnabled(false);
}
}).setOnSoftKeyboardOpenListener(new OnSoftKeyboardOpenListener() {
@OverRide
public void onKeyboardOpen(final int keyBoardHeight) {
// emojiPopup.dismiss();
}
}).setOnEmojiPopupDismissListener(new OnEmojiPopupDismissListener() {
@OverRide
public void onEmojiPopupDismiss() {
}
}).setOnSoftKeyboardCloseListener(new OnSoftKeyboardCloseListener() {
@OverRide
public void onKeyboardClose() {
emojiPopup.dismiss();
}
}).build(messageBox);
}
I'm trying to compile code that was working a few days ago. Right now, the compile issue I get is
Error:(151, 26) No resource found that matches the given name (at 'src' with value '@drawable/emoji_people').
Have been reported in quite a few issues.
I have a dialog box in which user can enter text and emoji.
But when i open emoji panel it shows above the keyboard instead of top of the keyboard.
I have given root view of the dialog box custom xml root view
Even though integrated physical keyboard are not popular anymore, there are high profile devices with them (eg: Blackberry Priv).
Hello. Thanks for so good lib.
Help me to resolve this problem (as here: #28 ), please:
Board with smiles opening good, but I want to switch smiles board to keybord by second tap to button.
So, smiles board opened, I tap on button, where this code:
if (main.globals_.emojiPopup.isShowing()){
//закрыть эмоции
//main.globals_.emojiPopup.dismiss();
//показать клавиатуру
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}else{
//открыть эмоции
main.globals_.emojiPopup.toggle();
}
and I see momental keyboard blink, closing keyboard and smiles board was closed.
If I delete the code for showing keyboard and uncomment main.globals_.emojiPopup.dismiss(); , I will see good changing from smiles to keboard and back. BUT, when I close keyboard or smiles by pressing "back" and trying to show smiles by button, I will see the bug as on screen from issue #28. What me do? How to set rootView again?
Sorry for my Russian English.
The current logic for showing the picker itself and the skin tone popup have some problems.
This includes:
OnGlobalLayoutListener
does not get called (#31).Activity
is paused, or orientation is changed. Other pickers like this do remain openMIN_KEYBOARD_HEIGHT
is hardcoded to 100 pixels. I doubt that there are keyboards smaller than that, but it is still risky.status_bar_height
, which could change or disappear in future versions.I tested around a bit, but couldn't really get to anything. One notable thing though is the following:
To make a popup window behave properly (Like I described above for the skin tone popup), one can set:
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
This resulted in this weird behaviour though:
I don't really know how to approach this. Do you know something @vanniktech? I will further investigate this though.
A lot of them are missing:
🇦🇫🇦🇽🇦🇱🇩🇿🇦🇸🇦🇩🇦🇴🇦🇮🇦🇶🇦🇬🇦🇷🇦🇲🇦🇼🇦🇺🇦🇹🇦🇿🇧🇸🇧🇭🇧🇩🇧🇧🇧🇾🇧🇪🇧🇿🇧🇯🇧🇲🇧🇹🇧🇴🇧🇶🇧🇦🇧🇼🇧🇷🇮🇴🇻🇬🇧🇳🇧🇬🇧🇫🇧🇮🇨🇻🇰🇭🇨🇲🇨🇦🇮🇨🇰🇾🇨🇫🇹🇩🇨🇱🇨🇳🇨🇽🇨🇨🇨🇴🇰🇲🇨🇬🇨🇩🇨🇰🇨🇷🇭🇷🇨🇺🇨🇼🇨🇾🇨🇿🇩🇰🇩🇯🇩🇲🇩🇴🇪🇨🇪🇬🇸🇻🇬🇶🇪🇷🇪🇪🇪🇹🇪🇺🇫🇰🇫🇴🇫🇯🇫🇮🇫🇷🇬🇫🇵🇫🇹🇫🇬🇦🇬🇲🇬🇪🇩🇪🇬🇭🇬🇮🇬🇷🇬🇱🇬🇩🇬🇵🇬🇺🇬🇹🇬🇬🇬🇳🇬🇼🇬🇾🇭🇹🇭🇳🇭🇰🇭🇺🇮🇸🇮🇳🇮🇩🇮🇷🇮🇶🇮🇪🇮🇲🇮🇱🇮🇹🇨🇮🇯🇲🇯🇵🇯🇪🇯🇴🇰🇿🇰🇪🇰🇮🇽🇰🇰🇼🇰🇬🇱🇦🇱🇻🇱🇧🇱🇸🇱🇷🇱🇾🇱🇮🇱🇹🇱🇺🇲🇴🇲🇰🇲🇬🇲🇼🇲🇾🇲🇻🇲🇱🇲🇹🇲🇭🇲🇶🇲🇷🇲🇺🇾🇹🇲🇽🇫🇲🇲🇩🇲🇨🇲🇳🇲🇪🇲🇸🇲🇦🇲🇿🇲🇲🇳🇦🇳🇷🇳🇵🇳🇱🇳🇨🇳🇿🇳🇮🇳🇪🇳🇬🇳🇺🇳🇫🇲🇵🇰🇵🇳🇴🇴🇲🇵🇰🇵🇼🇵🇸🇵🇦🇵🇬🇵🇾🇵🇪🇵🇭🇵🇳🇵🇱🇵🇹🇵🇷🇶🇦🇷🇪🇷🇴🇷🇺🇷🇼🇧🇱🇸🇭🇰🇳🇱🇨🇵🇲🇻🇨🇼🇸🇸🇲🇸🇹🇸🇦🇸🇳🇷🇸🇸🇨🇸🇱🇸🇬🇸🇽🇸🇰🇸🇮🇸🇧🇸🇴🇿🇦🇬🇸🇰🇷🇸🇸🇪🇸🇱🇰🇸🇩🇸🇷🇸🇿🇸🇪🇨🇭🇸🇾🇹🇼🇹🇯🇹🇿🇹🇭🇹🇱🇹🇬🇹🇰🇹🇴🇹🇹🇹🇳🇹🇷🇹🇲🇹🇨🇹🇻🇺🇬🇺🇦🇦🇪🇬🇧🇺🇸🇻🇮🇺🇾🇺🇿🇻🇺🇻🇦🇻🇪🇻🇳🇼🇫🇪🇭🇾🇪🇿🇲🇿🇼🇽🇪
Thank you for filing an issue. If this is a bug that you want to report, please take the time to provide some information:
problem is I am getting this, I imported the jar and the aar file.
Could not initialize class com.vanniktech.emoji.EmojiHandler
Screenshot(s) showing the issue and reprodution steps are appreciated.
Hello, when EmojiPopup is visible and I press back button on device, then Softkeyboard is dismissed, but Emoji Popup is not dismissed.
Let's add Night Theme Support to the sample and also see whether we need to change something in the library to support it properly or not.
How to reproduce:
[Emoji]EditText
emojiPopup.toggle()
Expected result:
The emoji popup is shown
Actual result:
Nothing happens. The soft keyboard stays open.
On android 6 emoji not averlays keyboard, emoji appear above the keyboard.
Tested on Nexus 7.
In your library you are storing emojis as separate files. And in total they make about 1000 image files. I am curious is there is performance issue to store and access emojis as separate files.
For example Telegram stores their emojis in sprites.
PNGs are quite heavy for all of the emojis.
Possible solutions:
I have a fragment containing several linear layouts with on linear layout at the bottom containing the EmojEditText and some buttons. I use the button to toggle the EmojPopup visibility.
Sometimes (let's say one in 10 times or 15 times) the emoj popup opens but the linear layout above it just disappears when I click the button. If I choose an emoj the popup disappears and the linear layout is visible again.
I cannot trigger this on purpose, seems like a race condition of some kind? Could it be related to wrong root view? I'm using view.getRootView() (view is the inflated view for the fragment).
Now we can only subclass EmojiTextView
to create emoji text views, because EmojiHandler
class is package-only. However, this is not possible to pass custom emoji size, except using attributes.
Please, make EmojiHandler
class public or provide function to override for EmojiTextView
to provide default value for emojiSize.
The problem appears in the Qabel-android client in versionn 0.12.0 and 0.12.1: https://github.com/Qabel/qabel-android/releases/tag/0.12.1-beta.3
To reproduce:
Expected behavior:
The soft keyboard hides and the emoji popup appears
Actual behavior:
The emoji-button changes the drawable to the keyboard drawable and the emoji popup does not appear, the keyboard stays visible. Clicking the emoji button again has no effect.
When I close the keyboard with the hardware button and then press the emoji button again, the emoji popup opens and everything works fine.
I also tried to bind the emoji popup on the root of the activities layout, but that had no effect.
version 0.3.0
If you call the method "dismiss ()", without closing the keyboard, then the keyboard when you close, "isKeyboardOpen" variable is "true". Accordingly, the call "toggle ()" will:
if (isKeyboardOpen) {
// If keyboard is visible, simply show the emoji popup
this.showAtBottom();
}
but no screen keyboard
P.S. sorry for my english
Thank you for filing an issue. If this is a bug that you want to report, please take the time to provide some information:
Screenshot(s) showing the issue and reprodution steps are appreciated.
It would be cool to be able to search for an Emoji using Text. Searching for punch yields for instance 👊. I don't know whether Emojis have associated tags or not and whether they are only in English or also other languages.
Basically reflect the search functionality from Github / Slack in the Library.
Hi,Thanks for sharing.
Failed to resolve: com.vanniktech:emoji:0.4.0-SNAPSHOT
This proplem how do solved?
i am triying to put the new version and i get
failed to resolve com.vanniktech:emoji-ios:0.4.0
i am following the instructions of here
https://github.com/vanniktech/Emoji/tree/readme
First, thanks for your awesome module.
I used it in my app, and it works very well.
But it may cause performance issues on some devices, in my case, Moto X Style with CM 13 (Android 6.0.1), but not with my Galaxy S4 (Android 4.4), LG G2 (Android 5.0).
And many users reported too, mostly Android 6.0.
The issue:
I have some fragments with EmojiPopup instance, after start and exit those fragments couple times, ListView scrolling skipped a lot, also with SwipeRefreshLayout pull to refresh action.
I checked setSizeForSoftKeyboard function, and found OnGlobalLayoutListener was attached to rootView but never removed. So rootView could be attached multiple listeners, cause performance degrade.
https://github.com/vanniktech/Emoji/blob/master/library/src/main/java/com/vanniktech/emoji/EmojiPopup.java#L142
So I hacked a little, remove OnGlobalLayoutListener on fragment destory.
Which solved my problem.
But I don't think it's a clean way to do it.
Maybe OnGlobalLayoutListener should be removed when measure is done?
Thanks.
I can help you with adding skin tones. Do you have ideas how to map them? Since skin toned emoji has two unicode characters (0x1f4aa 0x1f3fb) I am not sure how it can be handled.
EMOJIS_MAP.put(0x1f4aa, R.drawable.emoji_1f4aa_1f3fb);
Can be implemented once #77 is done.
When changing the skin tone of an Emoji in a Category the Emoji Icon in the list should be updated.
If we do this we should no longer then display 👊 & 👊🏻 in the recent Emojis. Instead just display the one that was used last.
Emoji's appear perfectly on edittext and textview. But when i do getText() on edittext, it returns " ���� testing emoji ", instead of unique codes for each emojis added.
I need to send obtained text to server when i send above text to server an entry has been created in database but nothing is saved on corresponding text column.
Please suggest any solution. Thanks.
Right now if you long press on an Emoji with a Skin Tone modifier you're still able to swipe, which means you can swipe to another category while the Skin Tone PopupWindow is still open. Another thing that works is scrolling up and down and then you're at a different position that you started with.
Telegram does a nice thing. If you select a skin tone, swipe gestures for categories are blocked and when you swipe you actually preselect the skin tone modifier. Once you release the swipe the selected skin tone is the one that will be applied.
Screenshots for clarification:
Thank you for filing an issue. If this is a bug that you want to report, please take the time to provide some information:
Screenshot(s) showing the issue and reprodution steps are appreciated.
I was using emoji for edittext in DialogFragment. But when i toggle, keyboard still display. Please check this issue. Thanks.
It's useless and mostly blocks the emoji on the right side
The emoji keyboard works perfectly yesterday when I started using it in my application except the landscape malfunctioning, but this morning another thing surface, the prompt is now showing above the soft keyboard without modifying anything.
The version used is:
compile 'com.vanniktech:emoji:0.3.0'
compile 'com.vanniktech:emoji:0.4.0
Hi Niklas,
First off, thank you for a great lib. I have used it in a library before and I am using it again for my current project. It is great.
Second, using 'compile 'com.vanniktech:emoji-ios:0.4.0'' results in IosEmojiProvider class not found. Basically, the whole ios package is not available. For now I imported the project as a module but would be helpful if you could please have a look into it.
Thanks,
Jean Marie
Thank you for filing an issue. If this is a bug that you want to report, please take the time to provide some information:
Screenshot(s) showing the issue and reprodution steps are appreciated.
i have an problem when i sent the image drawable as R.drawable.emoji_people then the smiley or everything works when i change the drawable to my own type image as of the imageview click then the smiley or default keyboard is not working properly
Need Data Binding support for EmojiTextView.Java
. In my Chat application, I am using Data Binding and EmojiTextView need to be bindable for Chat Messages.
Will need to enable data binding in build.gradle
. I can make PR if you guys are ok with binding support.
A lot are missing and so far I haven't figured out which ones exactly.
I found the error like this:
java.lang.IllegalStateException: Please install an EmojiProvider through the install method first.
Could you help me? previously it was worked.
How can I make emojiPopup dismiss() when soft keyboard is hidden, by example, by backpressed?
There's no way to do this in Builder, because while Builder isn't built, the popup instance isn't initialized and its dismiss() isn't accessible.
Builder is a private class, I can't create an instance of it and maybe build the thing twice as a workaround.
What could you suggest? When soft keyboard is hidden, emoji popup stays on, covering the input field with toggle button and I have no way to remove it from the screen.
This is a proposal for a large change in the library.
I think about switching to the emoji of EmojiOne. It is regularly updated, contains all of the latest emoji, has a friendly licence (creative commons) and provides mapping files for somewhat easy generation of mapping classes.
.java
files which map to correct values. This has the advantage that we could just rerun the script when files of EmojiOne have changed and simply copy the changes to the library.What do you think about this? I would happily submit a PR for that (in fact I'm already working on it, the script is nearly ready).
Those are missing:
💑👩❤️👩👨❤️👨💏👩❤️💋👩👨❤️💋👨👪👨👩👧👨👩👧👦👨👩👦👦👨👩👧👧👩👩👦👩👩👧👩👩👧👦👩👩👦👦👩👩👧👧👨👨👦👨👨👧👨👨👧👦👨👨👦👦👨👨👧👧
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.