emojicon - 在Android的TextView, EditText中显示emoji
d4nd
9年前
一个Android库可以在TextView, EditText中显示emoji。就像在 WhatsApp 中看到的一样。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:emojicon="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <com.rockerhieu.emojicon.EmojiconTextView android:id="@+id/txtEmojicon" android:text="I \ue32d emojicon" android:layout_width="match_parent" android:layout_height="wrap_content"/> <com.rockerhieu.emojicon.EmojiconEditText android:id="@+id/editEmojicon" android:text="I \ue32d emojicon" emojicon:emojiconSize="28sp" android:layout_width="match_parent" android:layout_height="wrap_content"/> <fragment android:id="@+id/emojicons" android:layout_width="match_parent" android:layout_height="220dp" class="com.rockerhieu.emojicon.EmojiconsFragment"/> </LinearLayout>
Usage
- EmojiconTextView: aTextViewwhich can render emojis.
- EmojiconEditText: aEditTextwhich can render emojis.
- EmojiconGridFragment: a fragment contains emojis in aGridViewfor the user to choose.
- EmojiconsFragment: a fragment contains many set of emojis for the user to choose.
Building in IntelliJ
Via Gradle:
compile 'com.rockerhieu.emojicon:library:1.0'