First of all look at the effect:
The files used are (the source file has, only contains emoticons, input boxes and other related documents, the project is the company projects, not public):
Res:
Drawable/face_del_icon.xml
Drawable/iv_face.xml
All pictures under drawable-ldpi
Configuration file under Raw
layout/item_face.xml Layout file
Layout/view_face_relativelayout.xml The layout file, note that the use method is called by the include
Java files:
Chatemoji.java
Faceadapter.java
Faceconversionutil.java//Note that this class requires additional code initialization
Viewpageradapter.java
/***************************************************************************/
After placing the above code in the appropriate location, use the following method:
Add the code to initialize the emoticon package when your program initializes:
/* emoji expression sub-thread initialization for chat interface Emoticons */ New Thread (new Runnable () { @Override publicvoid run () { Faceconversionutil.getinstace (). Getfiletext (Getapplication ()); // faceconversionutil.getinstace (). Getfiletext (chatpageactivity.this); } }). Start ();
The code in the layout file that uses the emoji input box:
<LinearLayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:orientation= "Horizontal" > <includeAndroid:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"Layout= "@layout/view_face_relativelayout" /> </LinearLayout>
SOURCE download
Android Development High imitation QQ expression selection, input box