A simple library to add Emoji support to your Android Application

文章推薦指數: 80 %
投票人數:10人

A simple library to add Emoji support to your Android app. In a PopupWindow Emojis can be chosen. In order to edit and display text with Emojis this library ... Skiptocontent {{message}} stefanhaustein / Emoji-1 Public forkedfromvanniktech/Emoji Notifications Star 1 Fork 260 AsimplelibrarytoaddEmojisupporttoyourAndroidApplication Apache-2.0License 1 star 260 forks Star Notifications Code Pullrequests 0 Actions Projects 0 Wiki Security Insights More Code Pullrequests Actions Projects Wiki Security Insights master Branches Tags Couldnotloadbranches Nothingtoshow Loading {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default Loading 1 branch 6 tags Code Loading Thisbranchisuptodatewithmaster. Contribute Thisbranchisnotaheadoftheupstreammaster. Nonewcommitsyet.Enjoyyourday! Openpullrequest Latestcommit   Gitstats 146 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime .buildscript     .github     app     code_quality_tools     emoji-google-compat     emoji-google     emoji-ios     emoji-kotlin     emoji-one     emoji-twitter     emoji     fastlane/metadata/android/en-US/images/phoneScreenshots     generator     gradle     .gitignore     .travis.yml     CHANGELOG.md     LICENSE     README.md     Screengrabfile     UPDATING.md     build.gradle     gradle.properties     gradlew     gradlew.bat     settings.gradle     Viewcode Emoji iOSEmojis EmojiOne Google Twitter CustomEmojis InsertingEmojis DisplayingEmojis Listeners CustomRecentEmojiimplementation CustomVariantEmojiimplementation Snapshots Proguard License README.md Emoji AsimplelibrarytoaddEmojisupporttoyourAndroidapp.InaPopupWindowEmojiscanbechosen.InordertoeditanddisplaytextwithEmojisthislibraryprovidespublicAPIs:EmojiEditText,EmojiTextView&EmojiButton. Thelibraryhas4differentproviderstochoosefrom(iOS,EmojiOne,Google&Twitter). iOSEmojis ForgettingtheaboveiOSEmojissimplyaddthedependencyandcodebelow. compile'com.vanniktech:emoji-ios:0.5.1' Andinstalltheprovider(preferablyinyourApplicationclass): EmojiManager.install(newIosEmojiProvider());//ThislineneedstobeexecutedbeforeanyusageofEmojiTextView,EmojiEditTextorEmojiButton. EmojiOne ForgettingtheaboveEmojiOneEmojissimplyaddthedependencyandcodebelow. compile'com.vanniktech:emoji-one:0.5.1' Andinstalltheprovider(preferablyinyourApplicationclass): EmojiManager.install(newEmojiOneProvider());//ThislineneedstobeexecutedbeforeanyusageofEmojiTextView,EmojiEditTextorEmojiButton. Google ForgettingtheaboveGoogleEmojissimplyaddthedependencyandcodebelow. compile'com.vanniktech:emoji-google:0.5.1' Andinstalltheprovider(preferablyinyourApplicationclass): EmojiManager.install(newGoogleEmojiProvider());//ThislineneedstobeexecutedbeforeanyusageofEmojiTextView,EmojiEditTextorEmojiButton. Twitter ForgettingtheaboveTwitterEmojissimplyaddthedependencyandcodebelow. compile'com.vanniktech:emoji-twitter:0.5.1' Andinstalltheprovider(preferablyinyourApplicationclass): EmojiManager.install(newTwitterEmojiProvider());//ThislineneedstobeexecutedbeforeanyusageofEmojiTextView,EmojiEditTextorEmojiButton. CustomEmojis IfyouwanttodisplayyourownEmojisyoucancreateyourownimplementationofEmojiProviderandpassittoEmojiManager.install. AllofthecoreAPIlaysin,whichisbeingpulledinautomaticallybytheprovidedimplementations(iOS,EmojiOne,Google&Twitter): compile'com.vanniktech:emoji:0.5.1' InsertingEmojis DeclareyourEmojiEditTextinyourlayoutxmlfile. ToopentheEmojiPopupexecutethecodebelow: finalEmojiPopupemojiPopup=EmojiPopup.Builder.fromRootView(rootView).build(emojiEditText); emojiPopup.toggle();//TogglesvisibilityofthePopup. emojiPopup.dismiss();//DismissesthePopup. emojiPopup.isShowing();//ReturnstruewhenPopupisshowing. TherootViewistherootViewofyourlayoutxmlfilewhichwillbeusedforcalculatingtheheightofthekeyboard. emojiEditTextistheEmojiEditTextthatyoudeclaredinyourlayoutxmlfile. DisplayingEmojis JustusetheEmojiTextViewandcallsetTextwiththeStringthatcontainsUnicodeencodedEmojis.TochangethesizeofthedisplayedEmojisusethelineHeightpropertyfromTextView. Listeners TheEmojiPopupbuilderallowsyoutodeclareseverallisteners. setOnSoftKeyboardCloseListener(OnSoftKeyboardCloseListenerlistener); setOnEmojiClickListener(OnEmojiClickListenerlistener); setOnSoftKeyboardOpenListener(OnSoftKeyboardOpenListenerlistener); setOnEmojiPopupShownListener(OnEmojiPopupShownListenerlistener); setOnEmojiPopupDismissListener(OnEmojiPopupDismissListenerlistener); setOnEmojiBackspaceClickListener(OnEmojiBackspaceClickListenerlistener); CustomRecentEmojiimplementation YoucanpassyourownimplementationoftherecentEmojis.JustletoneofyourclassesimplementtheRecentEmojiinterfaceandpassitwhenyou'rebuildingtheEmojiPopup: setRecentEmoji(yourClassThatImplementsRecentEmoji) Ifnoinstanceoranullinstanceissetthedefaultimplementationwillbeused. CustomVariantEmojiimplementation YoucanpassyourownimplementationofthevariantEmojis.JustletoneofyourclassesimplementtheVariantEmojiinterfaceandpassitwhenyou'rebuildingtheEmojiPopup: setVariantEmoji(yourClassThatImplementsVariantEmoji) Ifnoinstanceoranullinstanceissetthedefaultimplementationwillbeused. Snapshots ThislibraryisalsodistributedasaSNAPSHOTifyouliketocheckoutthelatestfeatures. Note:TheAPIisnotstableandmaychangeandbreakyourcodeatanytimeifyouuseaSNAPSHOT. Addthistoyourrepositories: maven{url"https://oss.sonatype.org/content/repositories/snapshots"} Andoneofthesetoyourdependencies: compile'com.vanniktech:emoji-ios:0.6.0-SNAPSHOT' compile'com.vanniktech:emoji-one:0.6.0-SNAPSHOT' compile'com.vanniktech:emoji-google:0.6.0-SNAPSHOT' compile'com.vanniktech:emoji-twitter:0.6.0-SNAPSHOT' Proguard Noconfigurationneeded. License Copyright(C)2016Vanniktech-NiklasBaudy LicensedundertheApacheLicense,Version2.0 About AsimplelibrarytoaddEmojisupporttoyourAndroidApplication Resources Readme License Apache-2.0License Releases 6 tags Packages0 Nopackagespublished Languages Java 98.4% JavaScript 1.5% Other 0.1% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?