Android Development High imitation QQ expression selection, input box

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.