rockerhieu / emojicon Goto Github PK
View Code? Open in Web Editor NEWA library to show emoji in TextView, EditText (like WhatsApp) for Android
License: Apache License 2.0
A library to show emoji in TextView, EditText (like WhatsApp) for Android
License: Apache License 2.0
The edittext widget don't have cursor in new emojicon version.
Hi! I'm working in a custom view where I draw some text using canvas.drawText(...). Is It possible to draw some emojicons using this canvas? Thanks so much for your help.
I get the following error. I think this issue is related to
https://code.google.com/p/android/issues/detail?id=77285.
Perhaps i'll try to fix it by myself in a few days, but i wanted to share this bug.
java.lang.IllegalStateException: Fragment EmojiconRecentsGridFragment{44be12c0 id=0x7f060030} is not currently in the FragmentManager
at android.support.v4.app.FragmentManagerImpl.putFragment(FragmentManager.java:571)
at android.support.v4.app.FragmentStatePagerAdapter.saveState(FragmentStatePagerAdapter.java:188)
at android.support.v4.view.ViewPager.onSaveInstanceState(ViewPager.java:1270)
at android.view.View.dispatchSaveInstanceState(View.java:13570)
at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2813)
at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2819)
at android.view.View.saveHierarchyState(View.java:13553)
at android.support.v4.app.FragmentManagerImpl.saveFragmentViewState(FragmentManager.java:1629)
at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1649)
at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:1710)
at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:524)
at android.app.Activity.performSaveInstanceState(Activity.java:1184)
at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1241)
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3331)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3390)
at android.app.ActivityThread.access$1100(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1279)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Why don't you update your project? The compile('...') for the 1.1 SNAPSHOT version in gradle returns an error and the 1.0 doesn't work. It isn't easy to implement in our projects and so on... I think that if you respect your work and yourself, you should upgrade this project as soon as possible, because it represents you. You've created a library that works only with your demo. You should make it more flexible to be easily implemented in our projects. Thank you in advance. Sorry for this poem but I had to do it.
Using IntelliJ and importing as
compile 'com.rockerhieu.emojicon:library:1.0'
However, in EmojiActivity.java, none of
mEditEmojicon.setUseSystemDefault(b)
mTxtEmojicon.setUseSystemDefault(b)
EmojiconsFragment.newInstance(useSystemDefault)
could be found.
Did I config the dependencies wrong or the library has a version mismatch with the example?
Thanks,
How can I add the unicodes of all the Emojicons into a hashmap or array? Please help.
This is a new task
@Gissues:{"order":87.5,"status":"done"}
Problem storing these emoji's to SQLite database and retrieving them as these emoji's support utf8mb4 encoding which is not supported by SQLite, i suppose. Currently if i try to store and retrieve from database it gives a ?? for each emoji.
How to store and retrieve these to android SQLite database.
Yeehaa
@Gissues:{"order":50,"status":"done"}
Hello,
I have problem with send the text with emoji to server.
When I send they are becoming to ???.
Server side work perfectly, because I have tested it with the iOS version.
Any suggestion?
Thanks,
Vardan
First let me thanks for sharing such an awesome library
I have implemented the EmojiconEditText in my app. Now I want to get the Text+Emojis from the Edit Text. and then I want to send the text to a php service and save in the My Sql Database.
Im getting the (??????????) instead of the Emojis via myEditText.getText().toString(); is there any other method for this.
Please Help
Can we have the EmojiconsFragment class in the form of a dialog(using DialogFragment) so that we can easily replace this fragment in place of the soft keyboard. This is how whatsapp and other messaging apps smoothly toggle between qwerty keyboard and emoticons
Hi,
I am trying to build Kontalk which pulls in emojicon as a submodule, but it fails:
http://pastebin.com/Q4VRhnyF
I have also tried directly building emojicon with ./gradlew clean build --debug
, it results in the following log:
http://pastebin.com/Zj5L1rZi
Thanks for your help!
i got this error NoSuchFieldError :com.rockerhieu.emojicon.R$id.emojis_tab_0_recents
@rockerhieu , thanks for a great project!
The only other issue besides the lag, is the lack of a 'recently used' tab in the keyboard.
when i enter more emojicons and they are out of the view then I am not able to show ellipsis. I tried android:singleLine="true"
android:ellipsize="end"
but not working.
Please help.
Guys, I've just leaving this as a reminder to release a new version (1.0.1) or so, since this build.gradle line:
compile 'com.android.support:support-v4:+'
is now the reason why this library must now be included like this:
compile ('com.rockerhieu.emojicon:library:1.0') {
exclude group: 'com.android.support', module:'support-v4'
}
since the new support-v4:22.2.0 has some breaking issues related to missing classes and interfaces.
I did notice that the new build.gradle is now fixed, so it's just a matter of creating a new release.
The library is pretty cool by the way.
Regards.
Caused by: java.lang.ClassCastException: com.rockerhieu.emojicon.EmojiconsFragment cannot be cast to android.app.Fragment
at android.app.Fragment.instantiate(Fragment.java:577)
at android.app.Fragment.instantiate(Fragment.java:552)
at android.app.Activity.onCreateView(Activity.java:4656)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
at android.app.Activity.setContentView(Activity.java:1867)
at com.example.rehan.emojiicon.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
I was getting an Exception about casting Object[] to Emojicon[] whenever I try bringing the app back to foreground. I traced the bug down to the EmojiconGridFragment and I've already created a pull request against this.
I haven't tested with actual apps, but I guess the same will happen in as much as the emoji keyboard was active the before the app was taken to background
Hi your library works fine when lazy swipe is not enabled. once i install and enable lazy swipe app emoji keyboard doesn't show.
@rockerhieu
I used your example code in my project. Used the same Layout file. Imported the dependencies in gradle. Everything is done as mentioned. But still I get an error in the Cannot Resolve method error for
"setUseSystemDefault(b)" and "EmojiconsFragment.newInstance(useSystemDefault)"
Am I missing something?
Hi Sir,
I'm referring your emoji library from github. But I am not receiving some emoji from database server which used Emojicon.fromCodePoint(0x1f604) method. But emoji with Emojicon.fromChar((char) 0x263a) method works fine.
Please help me Sir. What changes should I do to get those emoji.
when I rename emoji file name with working emoji file name (.png file name) then that emoji work fine..
those starting with 0x1f__ are not working..
(not working) 4 byte
07-09 15:14:08.365: I/PARAMS(6801): username=xyz&password=xyz&to=abc&message=%F0%9F%98%8A&action=sendMessage&
(working) 3 byte
07-09 15:13:58.878: I/PARAMS(6801): username=xyz&password=xyz&to=abc&message=%E2%98%BA&action=sendMessage&
plz sir
Shouldn't be more optimal to use plain ImageViews instead of the TextView approach? On medium to low end devices the emoji panel takes a lot to load (like ten seconds). Even on my Samsung I9100 it takes like 4-5 seconds to load.
Before sending you a patch, I'd like to know if using TextView was a deliberate decision and, if that's the case, reasons why we can't use ImageView.
Hello, Everyone!
I have kept trying to change the size of the emojicons shown on my chat app which uses this repository for 2 days but eventually failed.
I have tried several options: XML layout, runtime modification on the emojicon size.
Thanks, in advance.
Borys
Is there any way to calculate the appearance of emojicon in EmojiconTextView accurately? Such as 😎😎😎 is consider as 3 characters.
Thanks in advance for willing to help.
hi,I have a question when I use the emojiconTextView.It can't work when I write some urls because the linkHit in EmojiconTextView is false(or dontConsumeNonUrlClicks is true).why set it this?Then what will be the consequence if I change it.
hello
i'm finding a problem in rockerhieu-emojicon keyboard downloaded from this link
https://github.com/rockerhieu/emojicon
when launching the example, in the "recent" fragment numbers are showing and they are not pictures, just numbers.. any one have any idea how to solve this?
Right now, the library uses Apple's emoji icons, which are used by thousands of apps, but that doesn't make them free. They're still copyrighted and not released under any free license.
Why not use a free icon set, e.g. Android's old emoji font (4.1 - 4.4)?
All of Android's emoji are here as PNGs, for example.
I want use the emojicon, and the parent is a fragment, I mean the EditEmojicon view in a fragment. I can't use it! So How to use it in a fragment? thanks...
If I use a EmojiconTextView and set emojicon:emojiconSize="28sp" (and android:textSize="16sp") the emojicon will be cutted of on top and bottom if there is no other text in the field.
If there is text and an emojicon it will be displayed correctly until the emojicon is wrapped alone to a new line.
So, I think the necessary size of the emojicon will not be given to the TextView element to display correctly.
PS: width and height of the EmojiconTextView are wrapped to content.
In an earlier version this problem didn't arise.
Is that possible to make the emojicon ellipsize in the end of the emojiconTextView without reducing the size?
This is a new task
@Gissues:{"order":75,"status":"done"}
I sadly do not know exactly how to reproduce this...
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.actidoo.app.android/com.actidoo.app.android.MainActivity}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to com.rockerhieu.emojicon.emoji.Emojicon[]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2115)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2153)
at android.app.ActivityThread.access$700(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5031)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: java.lang.Object[] cannot be cast to com.rockerhieu.emojicon.emoji.Emojicon[]
at com.rockerhieu.emojicon.EmojiconGridFragment.onViewCreated(EmojiconGridFragment.java:54)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:956)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1103)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1901)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1518)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1103)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1901)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:567)
at com.my.app.android.MainActivity.onStart(MainActivity.java:419)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
at android.app.Activity.performStart(Activity.java:5068)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2088)
... 11 more
Hi,
Thanks for the wonderful library. When i print the entered text with Emoji icons it displayed like text with some drawable, is it possible to print that emoji as unicode format.
Thanks for writing this!
Some tips for installation, at least for Windows 7:
One tip that would have saved me time would be in the Eclipse Integration Gradle installation - don't waste time installing the STS dashboard. Just install from the update site, and make sure that you uncheck the Spring-based tools (which are checked by default). If you don't, then you may run into other dependency issues, like I did.
Another error resulted in having to create a file called local.properties in the emojicon dir with this line:
sdk.dir=/this/is/my/sdk/loc
Obviously you will need to change that for your own sdk location.
If you hard code with c:\this\is\my\sdk\loc, it doesn't work.
There may be a default root dir, but I didn't want to spend more time playing around with it.
Hi!
I'm trying to compile library with 1.1 version, but maven artifact is not being found. Is there any chance you could please push the latest version. Same with 1.2-SNAPSHOT.
Thanks in advance!
Hi everyone , I try to add the library to my project ,after adding the gradle ->
compile 'com.rockerhieu.emojicon:library:1.0'
I get this error in android studio:
Error:(13, 9) Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcherr) from AndroidManifest.xml:13:9
is also present at com.rockerhieu.emojicon:library:1.0:4:45 value=(@drawable/ic_launcher)
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:11:5 to override
with some search in google and stackoverflow I find out a solution
solution is that , if add this line of code to my manifest it can solve the error ->
tools:replace='android:icon'
I add the code , the error for icon gone , but now i have another error:
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/payamprivate/Library/Android/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 1
can someone help me , to solve the problem ... thanks
hi,
This is not an issue par se, just seeking some help on hiding and showing the EmojiconsFragment.
I tried doing it this way;
Fragment mFragment = new EmojiconsFragment();
getSupportFragmentManager().beginTransaction().hide(mFragment).commit();
This however did not work.
Any ideas on how to achieve this?
Thanks
When i am sending message from my device to other. On samsung device it shows me the black white format and on same of the android device it shows only boxes.
when i add the emoji list fragment (EmojiconsFragment) like the example , its return this error : ERROR/AndroidRuntime(419): FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.ChatViewActivity}: android.view.InflateException: Binary XML file line #89: Error inflating class fragment
Could you suggest a method which I can use to open and close the grid with a buttonm like telegram?
Hello,
First of all, congratulations for the library, it's great!
Is it possible to create a PopupWindow with fragment "EmojiconsFragment" to do a layer like whattsapp (to toggle keyboard to emojicons)?
I tried this with the DialogFragment and PopupWindow and there's always the error:
IllegalArgumentException: No view found for id...
If I attach the fragment in the general layout, it works correctly, but not in this case.
Thanks
I follow your example to work with EditText. I can type in the emoji from keyboard but when I do editText.getText(), then it shows me the symbol, not the unicode. PLease guide in this regard. Thanks for the library.
Hi rockerhieu,
First, thanks for the great library, I'm trying to use your library in my project, I'm using listfragment, the code is below,
public class DetailsFragment extends ListFragment implements
LoaderCallbacks,
EmojiconGridFragment.OnEmojiconClickedListener,
EmojiconsFragment.OnEmojiconBackspaceClickedListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
getLoaderManager().initLoader(0, null, this);
}
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.details_listview, container, false);
}
@Override
public void onEmojiconClicked(Emojicon emojicon) {
EmojiconsFragment.input(comment, emojicon);
}
@Override
public void onEmojiconBackspaceClicked(View v) {
EmojiconsFragment.backspace(comment);
}
@Override
public void onEmojiconClicked(Emojicon emojicon) {
EmojiconsFragment.input(mEditEmojicon, emojicon);
}
@Override
public void onEmojiconBackspaceClicked(View v) {
EmojiconsFragment.backspace(mEditEmojicon);
}
}
Once I add the fragment below, to the layout
<fragment
android:id="@+id/emojicons"
android:layout_width="match_parent"
android:layout_height="220dp"
class="com.rockerhieu.emojicon.EmojiconsFragment" />
I get the error below (abbreviated),
Binary XML file line #38: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #38: Error inflating class fragment
Caused by: java.lang.IllegalArgumentException: com.sso.android.shora.SsoActivity@42c28918 must implement interface OnEmojiconBackspaceClickedListener
when I remove the part everything works fine, is it possible to use your library with ListFragment?
Please let me know if you need more details.
Great Work!
But it's too laggy. I think if you used one image for each category will solve the problem.
https://github.com/DrKLO/Telegram/tree/master/TMessagesProj/src/main/assets
You can't just add compile row to gradle build script like this:
compile 'com.rockerhieu.emojicon:library:1.0'
You will get an error: Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
Temporary solution is to put next lines into project build.gradle:
compile('com.rockerhieu.emojicon:library:1.0') {
exclude group: 'com.android.support', module:'support-v4'
}
If I modify your library for a more Android-ish style for the pager buttons (that is, moving them on top of the grid and applying styles from the LatinIME from AOSP), would you accept that? This view seems so "iOS" :-)
I will implement this in my fork anyway, although I'd like to know if you would accept that: in that case, I'd be careful to not mess with the XML files and the drawables too much (please note that I'll remove the "orca_" prefix which I guess you took from Facebook app).
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.