欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Android Emoji表情字符列表

程序员文章站 2022-06-17 15:16:25
https://apps.timwhitlock.info/emoji/tables/unicodeimport android.content.Context;import android.view.Gravity;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.TextView;import java.util.Arr...

https://apps.timwhitlock.info/emoji/tables/unicode

import android.content.Context; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.ArrayList; class EmojiAdapter extends BaseAdapter { private Context mContext; private ArrayList<String> emojis; public EmojiAdapter(Context context, ArrayList<String> emojis){ mContext = context; this.emojis = emojis; } public int getCount() { return emojis.size(); } public Object getItem(int position) { return emojis.get(position); } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { TextView tv_emoji = null; if (convertView == null) { tv_emoji = new TextView(mContext); tv_emoji.setTextSize(25); convertView = tv_emoji; convertView.setTag(tv_emoji); tv_emoji.setGravity(Gravity.CENTER); } else { tv_emoji = (TextView) convertView.getTag(); } tv_emoji.setText(emojis.get(position)); return convertView; } public static String parseUnifiedCode(String unifiedCode) { return new String(Character.toChars(Integer.parseInt(unifiedCode.replace("U+", ""), 16))); } } class EmojiProvider{ public final static ArrayList<String> emojis = new ArrayList<String>(){ { add("
相关标签: 输入法 android