android 開發高仿QQ表情選擇、輸入框

來源:互聯網
上載者:User

標籤:

首先大家看效果:

用到的檔案有(源碼檔案有,只包含表情、輸入框等有關檔案,工程項目是公司項目,恕不公開啦):

res:

    drawable/face_del_icon.xml

    drawable/iv_face.xml

    drawable-ldpi下所有圖片

    raw下的設定檔

    layout/item_face.xml   布局檔案

    layout/view_face_relativelayout.xml  布局檔案,注意使用方法是通過include調用的

java檔案:

    ChatEmoji.java

    FaceAdapter.java

    FaceConversionUtil.java  //注意該類需要另外的代碼初始化

    ViewPagerAdapter.java

/***************************************************************************/

將以上代碼放置到相應的位置後,使用方法如下:

在你的程式初始化時加入初始化表情包的代碼:

/*emoji表情子線程初始化,用於聊天介面表情*/        new Thread(new Runnable() {            @Override            public void run() {                FaceConversionUtil.getInstace().getFileText(getApplication());                //FaceConversionUtil.getInstace().getFileText(ChatPageActivity.this);            }        }).start();

 

布局檔案中使用表情輸入框的代碼:

<LinearLayout                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:orientation="horizontal" >                <include                    android:layout_width="fill_parent"                    android:layout_height="wrap_content"                    layout="@layout/view_face_relativelayout" />            </LinearLayout>

 

源碼下載

android 開發高仿QQ表情選擇、輸入框

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.