android emoticonsKeyboard support emoji and user-defined emoticon. easy to integrated into your project - GitHub - w446108264/XhsEmoticonsKeyboard: android ...
Skiptocontent
{{message}}
w446108264
/
XhsEmoticonsKeyboard
Public
Notifications
Star
2.8k
Fork
604
androidemoticonsKeyboardsupportemojianduser-definedemoticon.easytointegratedintoyourproject
2.8k
stars
604
forks
Star
Notifications
Code
Issues
36
Pullrequests
1
Actions
Projects
0
Wiki
Security
Insights
More
Code
Issues
Pullrequests
Actions
Projects
Wiki
Security
Insights
master
Branches
Tags
Couldnotloadbranches
Nothingtoshow
Loading
{{refName}}
default
Couldnotloadtags
Nothingtoshow
{{refName}}
default
Loading
2
branches
7
tags
Code
Loading
Latestcommit
Gitstats
25
commits
Files
Permalink
Failedtoloadlatestcommitinformation.
Type
Name
Latestcommitmessage
Committime
Simple2
updatecompile'com.github.w446108264:AndroidEmoji:1.3-withsource'fo…
Jun13,2016
XhsEmoticonsKeyboard
fixissues#17
Jun2,2016
output
uploadanewsimpleapk
Oct12,2016
.gitignore
EmoticonsKeyboard
Mar6,2015
README.md
updatereadme
Mar2,2017
Viewcode
XhsEmoticonsKeyboard
Features
ScreenRecrod
Emoji
SamplesAPK
GradleDependency
SamplesUsage
Else
SimpleDefaultKeyboardLayoutTree「SVGhighdefinition」
Contact&Help
License
README.md
XhsEmoticonsKeyboard
j.s🇨🇳
最良心的开源表情键盘解决方案。
Features
API>9
表情键盘支持无闪烁自跟随系统软键盘高度,及支持自定义高度
表情支持自定义格式,支持任意来源
组件支持完全自定义,样式支持任意更改
支持全屏
默认微信键盘样式
赠QQ键盘高仿,不谢
ScreenRecrod
Emoji
alibaboutemoji->「w446108264/AndroidEmoji」
SamplesAPK
YoucandownloadasampleAPK
or
Simple2APK
GradleDependency
Usersofyourlibrarywillneedaddthejitpack.iorepository:
allprojects{
repositories{
jcenter()
maven{url"https://jitpack.io"}
}
}
and:
dependencies{
compile'com.github.w446108264:XhsEmoticonsKeyboard:2.0.4'
}
SamplesUsage
demo->Demo
//simple
//https://github.com/w446108264/XhsEmoticonsKeyboard/blob/master/Simple2/app/src/main/java/com/simple2/MainActivity.java
//https://github.com/w446108264/XhsEmoticonsKeyboard/blob/master/XhsEmoticonsKeyboard/app/src/main/java/com/xhsemoticonskeyboard/common/SimpleCommonUtils.java
//dot'tforget
//compile'com.github.w446108264:AndroidEmoji:1.0.0'
finalXhsEmoticonsKeyBoardek_bar=(XhsEmoticonsKeyBoard)findViewById(R.id.ek_bar);
//sourcedata
ArrayListemojiArray=newArrayList<>();
Collections.addAll(emojiArray,DefEmoticons.sEmojiArray);
//emoticonclick
finalEmoticonClickListeneremoticonClickListener=newEmoticonClickListener(){
@Override
publicvoidonEmoticonClick(Objecto,intactionType,booleanisDelBtn){
if(isDelBtn){
intaction=KeyEvent.ACTION_DOWN;
intcode=KeyEvent.KEYCODE_DEL;
KeyEventevent=newKeyEvent(action,code);
ek_bar.getEtChat().onKeyDown(KeyEvent.KEYCODE_DEL,event);
}else{
if(o==null){
return;
}
Stringcontent=null;
if(oinstanceofEmojiBean){
content=((EmojiBean)o).emoji;
}
intindex=ek_bar.getEtChat().getSelectionStart();
Editableeditable=ek_bar.getEtChat().getText();
editable.insert(index,content);
}
}
};
//emoticoninstantiate
finalEmoticonDisplayListeneremoticonDisplayListener=newEmoticonDisplayListener(){
@Override
publicvoidonBindView(inti,ViewGroupviewGroup,EmoticonsAdapter.ViewHolderviewHolder,Objectobject,finalbooleanisDelBtn){
finalEmojiBeanemojiBean=(EmojiBean)object;
if(emojiBean==null&&!isDelBtn){
return;
}
viewHolder.ly_root.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
if(isDelBtn){
viewHolder.iv_emoticon.setImageResource(R.mipmap.icon_del);
}else{
viewHolder.iv_emoticon.setImageResource(emojiBean.icon);
}
viewHolder.rootView.setOnClickListener(newView.OnClickListener(){
@Override
publicvoidonClick(Viewv){
emoticonClickListener.onEmoticonClick(emojiBean,0,isDelBtn);
}
});
}
};
//pageinstantiate
PageViewInstantiateListenerpageViewInstantiateListener=newPageViewInstantiateListener(){
@Override
publicViewinstantiateItem(ViewGroupviewGroup,inti,EmoticonPageEntitypageEntity){
if(pageEntity.getRootView()==null){
EmoticonPageViewpageView=newEmoticonPageView(viewGroup.getContext());
pageView.setNumColumns(pageEntity.getRow());
pageEntity.setRootView(pageView);
try{
EmoticonsAdapteradapter=newEmoticonsAdapter(viewGroup.getContext(),pageEntity,null);
//emoticoninstantiate
adapter.setOnDisPlayListener(emoticonDisplayListener);
pageView.getEmoticonsGridView().setAdapter(adapter);
}catch(Exceptione){
e.printStackTrace();
}
}
returnpageEntity.getRootView();
}
};
//build
EmoticonPageSetEntityxhsPageSetEntity
=newEmoticonPageSetEntity.Builder()
.setLine(3)
.setRow(7)
.setEmoticonList(emojiArray)
.setIPageViewInstantiateItem(pageViewInstantiateListener)
.setShowDelBtn(EmoticonPageEntity.DelBtnStatus.LAST)
.setIconUri(ImageBase.Scheme.DRAWABLE.toUri("ic_launcher"))
.build();
PageSetAdapterpageSetAdapter=newPageSetAdapter();
pageSetAdapter.add(xhsPageSetEntity);
ek_bar.setAdapter(pageSetAdapter);
classEmojiFilterextendsEmoticonFilter{
privateintemojiSize=-1;
@Override
publicvoidfilter(EditTexteditText,CharSequencetext,intstart,intlengthBefore,intlengthAfter){
emojiSize=emojiSize==-1?EmoticonsKeyboardUtils.getFontHeight(editText):emojiSize;
clearSpan(editText.getText(),start,text.toString().length());
Matcherm=EmojiDisplay.getMatcher(text.toString().substring(start,text.toString().length()));
if(m!=null){
while(m.find()){
StringemojiHex=Integer.toHexString(Character.codePointAt(m.group(),0));
EmojiDisplay.emojiDisplay(editText.getContext(),editText.getText(),emojiHex,emojiSize,start+m.start(),start+m.end());
}
}
}
privatevoidclearSpan(Spannablespannable,intstart,intend){
if(start==end){
return;
}
EmojiSpan[]oldSpans=spannable.getSpans(start,end,EmojiSpan.class);
for(inti=0;i=Build.VERSION_CODES.KITKAT){
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
youshouldaddaLayoutontheoutside,demo->SimpleTranslucentChatActivity
SimpleDefaultKeyboardLayoutTree「SVGhighdefinition」
Contact&Help
Pleasefellfreetocontactmeifthereisanyproblemwhenusingthelibrary.
email:[email protected]
License
MITLicense
Copyright(c)2017w446108264
Permissionisherebygranted,freeofcharge,toanypersonobtainingacopy
ofthissoftwareandassociateddocumentationfiles(the"Software"),todeal
intheSoftwarewithoutrestriction,includingwithoutlimitationtherights
touse,copy,modify,merge,publish,distribute,sublicense,and/orsell
copiesoftheSoftware,andtopermitpersonstowhomtheSoftwareis
furnishedtodoso,subjecttothefollowingconditions:
Theabovecopyrightnoticeandthispermissionnoticeshallbeincludedinall
copiesorsubstantialportionsoftheSoftware.
THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSOR
IMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOFMERCHANTABILITY,
FITNESSFORAPARTICULARPURPOSEANDNONINFRINGEMENT.INNOEVENTSHALLTHE
AUTHORSORCOPYRIGHTHOLDERSBELIABLEFORANYCLAIM,DAMAGESOROTHER
LIABILITY,WHETHERINANACTIONOFCONTRACT,TORTOROTHERWISE,ARISINGFROM,
OUTOFORINCONNECTIONWITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHE
SOFTWARE.
About
androidemoticonsKeyboardsupportemojianduser-definedemoticon.easytointegratedintoyourproject
Resources
Readme
Releases
7
2.0.4
Latest
Jun2,2016
+6releases
Packages0
Nopackagespublished
Languages
Java
100.0%
Youcan’tperformthatactionatthistime.
Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession.
Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.