vanniktech/Emoji: A simple library to add Emoji ... - GitHub

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

A library to add Emoji support to your Android app. Emojis can be picked in a PopupWindow. In order to edit and display text with Emojis this library provides ... Skiptocontent {{message}} vanniktech / Emoji Public Notifications Star 1.3k Fork 260 AsimplelibrarytoaddEmojisupporttoyourAndroidApplication Apache-2.0License 1.3k stars 260 forks Star Notifications Code Issues 8 Pullrequests 13 Actions Security Insights More Code Issues Pullrequests Actions Security Insights master Branches Tags Couldnotloadbranches Nothingtoshow Loading {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default Loading 16 branches 9 tags Code Loading Latestcommit vanniktech AddDependabot.(#512) … 9d9dfe0 Oct1,2021 AddDependabot.(#512) 9d9dfe0 Gitstats 231 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime .buildscript     .github     app     code_quality_tools     emoji-facebook     emoji-google-compat     emoji-google     emoji-ios     emoji-kotlin     emoji-material     emoji-twitter     emoji     fastlane/metadata/android/en-US/images/phoneScreenshots     generator     gradle/wrapper     .gitignore     CHANGELOG.md     LICENSE     README.md     Screengrabfile     UPDATING.md     build.gradle     gradle.properties     gradlew     gradlew.bat     lint.xml     settings.gradle     Viewcode Emoji iOSEmojis Google Facebook Twitter CustomEmojis Setup InsertingEmojis DisplayingEmojis EmojiPopupListeners EmojiPopupConfiguration CustomRecentEmojiimplementation CustomVariantEmojiimplementation Animations Customkeyboardenterandexitanimations Custompagetransformers Othergoodies Snapshots Proguard License README.md Emoji AlibrarytoaddEmojisupporttoyourAndroidapp.EmojiscanbepickedinaPopupWindow.InordertoeditanddisplaytextwithEmojisthislibraryprovidespublicAPIs: EmojiAutoCompleteTextView EmojiButton EmojiCheckbox EmojiEditText EmojiMultiAutoCompleteTextView EmojiTextView There'salsoaEmojiLayoutFactory,whichcanbeusedtogetautomaticEmojisupportwhenusingnormalAndroidViewssuchasTextView,Checkbox,etc. MaterialDesignLibrarybindingscanbeincludedvia: implementation"com.vanniktech:emoji-material:0.8.0" EmojiMaterialButton EmojiMaterialRadioButton MaterialCheckBox There'salsoaMaterialEmojiLayoutFactory,whichcanbeusedtogetautomaticEmojisupport. Thelibraryhas4differentproviderstochoosefrom(iOS,Google,Facebook&Twitter). iOSEmojis ForgettingtheaboveiOSEmojissimplyaddthedependencyandcodebelow. implementation"com.vanniktech:emoji-ios:0.8.0" Andinstalltheproviderinyourapplicationclass. EmojiManager.install(newIosEmojiProvider()); Google ForgettingtheaboveGoogleEmojissimplyaddthedependencyandcodebelow. implementation"com.vanniktech:emoji-google:0.8.0" Andinstalltheproviderinyourapplicationclass. EmojiManager.install(newGoogleEmojiProvider()); Facebook ForgettingtheaboveFacebookEmojissimplyaddthedependencyandcodebelow. implementation"com.vanniktech:emoji-facebook:0.8.0" Andinstalltheproviderinyourapplicationclass. EmojiManager.install(newFacebookEmojiProvider()); Twitter ForgettingtheaboveTwitterEmojissimplyaddthedependencyandcodebelow. implementation"com.vanniktech:emoji-twitter:0.8.0" Andinstalltheproviderinyourapplicationclass. EmojiManager.install(newTwitterEmojiProvider()); CustomEmojis IfyouwanttodisplayyourownEmojisyoucancreateyourownimplementationofEmojiProviderandpassittoEmojiManager.install. AllofthecoreAPIlaysinemoji,whichisbeingpulledinautomaticallybytheprovidedimplementations: implementation"com.vanniktech:emoji:0.8.0" Setup InsertingEmojis DeclareyourEmojiEditTextinyourlayoutxmlfile. ToopentheEmojiPopupexecutethecodebelow: finalEmojiPopupemojiPopup=EmojiPopup.Builder.fromRootView(rootView).build(emojiEditText); emojiPopup.toggle();//TogglesvisibilityofthePopup. emojiPopup.dismiss();//DismissesthePopup. emojiPopup.isShowing();//ReturnstruewhenPopupisshowing. TherootViewistherootViewofyourlayoutxmlfilewhichwillbeusedforcalculatingtheheightofthekeyboard. emojiEditTextistheEmojiEditTextthatyoudeclaredinyourlayoutxmlfile. DisplayingEmojis JustusetheEmojiTextViewandcallsetTextwiththeStringthatcontainsUnicodeencodedEmojis.TochangethesizeofthedisplayedEmojisusethelineHeightpropertyfromTextView. EmojiPopupListeners TheEmojiPopupbuilderallowsyoutodeclareseverallisteners. setOnSoftKeyboardCloseListener(OnSoftKeyboardCloseListenerlistener); setOnEmojiClickListener(OnEmojiClickListenerlistener); setOnSoftKeyboardOpenListener(OnSoftKeyboardOpenListenerlistener); setOnEmojiPopupShownListener(OnEmojiPopupShownListenerlistener); setOnEmojiPopupDismissListener(OnEmojiPopupDismissListenerlistener); setOnEmojiBackspaceClickListener(OnEmojiBackspaceClickListenerlistener); EmojiPopupConfiguration CustomRecentEmojiimplementation YoucanpassyourownimplementationoftherecentEmojis.ImplementtheRecentEmojiinterfaceandpassitwhenyou'rebuildingtheEmojiPopup: setRecentEmoji(yourClassThatImplementsRecentEmoji) Ifnoinstanceoranullinstanceissetthedefaultimplementationwillbeused. CustomVariantEmojiimplementation YoucanpassyourownimplementationofthevariantEmojis.ImplementtheVariantEmojiinterfaceandpassitwhenyou'rebuildingtheEmojiPopup: setVariantEmoji(yourClassThatImplementsVariantEmoji) Ifnoinstanceoranullinstanceissetthedefaultimplementationwillbeused. Animations Customkeyboardenterandexitanimations YoucanpassyourownanimationstyleforenterandexittransitionsoftheEmojikeyboardwhileyou'rebuildingtheEmojiPopup: setKeyboardAnimationStyle(R.style.emoji_fade_animation_style); IfnostyleissetthekeyboardwillappearandexitasaregularPopupWindow. Thislibrarycurrentlyshipswithtwoanimationstylesasanexample: R.style.emoji_slide_animation_style R.style.emoji_fade_animation_style Custompagetransformers YoucanpassyourownPageTransformerfortheEmojikeyboardViewPagerwhileyou'rebuildingtheEmojiPopup: setPageTransformer(newMagicTransformer()); IfnotransformerissetViewPagerwillbehaveasitsusualself.PleasedonotethatthislibrarycurrentlydoesnotshipanyexamplePageTransformers. Othergoodies MaximalNumberOfEmojisInputFiltercanbeusedtolimitthenumberofEmojisonecantypeintoanEditText OnlyEmojisInputFiltercanbeusedtolimittheinputofanEditTexttoemojionly SingleEmojiTraitcanbeusedtoforceasingleemojiwhichcanbereplacedbyanewone EmojiEditText#disableKeyboardInput()todisablenormalkeyboardinput.Toundocall#enableKeyboardInput() Snapshots ThislibraryisalsodistributedasaSNAPSHOTifyouliketocheckoutthelatestfeatures. Note:TheAPIisnotstableandmaychangeandbreakyourcodeatanytimeifyouuseaSNAPSHOT. Addthistoyourrepositories: maven{url"https://oss.sonatype.org/content/repositories/snapshots"} Andoneofthesetoyourdependencies: implementation"com.vanniktech:emoji:0.9.0-SNAPSHOT" implementation"com.vanniktech:emoji-ios:0.9.0-SNAPSHOT" implementation"com.vanniktech:emoji-google:0.9.0-SNAPSHOT" implementation"com.vanniktech:emoji-twitter:0.9.0-SNAPSHOT" implementation"com.vanniktech:emoji-facebook:0.9.0-SNAPSHOT" implementation"com.vanniktech:emoji-material:0.9.0-SNAPSHOT" Proguard Noconfigurationneeded. License Copyright(C)2016-NiklasBaudy,RubenGees,MarioĐanićandcontributors LicensedundertheApacheLicense,Version2.0 About AsimplelibrarytoaddEmojisupporttoyourAndroidApplication Topics android emoji emojione ios-emojis Resources Readme License Apache-2.0License Releases 8 0.7.0 Latest Aug19,2020 +7releases Packages0 Nopackagespublished Contributors24 +13contributors Languages Java 98.8% Other 1.2% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?