Android Emoji表情字符列表
程序员文章站
2022-03-23 08:03:33
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("
上一篇: 数据结构序列求权值
下一篇: 华为新专利曝光:凸起上边框+无刘海全面屏
推荐阅读