@SuppressWarnings("deprecation") @SuppressLint("InflateParams") @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder vh = null; if (convertView == null) { convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.v2_list_cell_emoji_item, null); vh = new ViewHolder(convertView); convertView.setTag(vh); } else { vh = (ViewHolder) convertView.getTag(); } if (position < getCount() - 1) { Emoji item = mEmojis.get(position); vh.icon.setBackgroundDrawable(null); vh.icon.setImageResource(item.getResId()); } else { vh.icon.setImageBitmap(null); vh.icon.setBackgroundResource(R.drawable.btn_del_selector); } RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, mEmojiHeight); vh.icon.setLayoutParams(lp); return convertView; }
public View getView(int i, View view, ViewGroup paramViewGroup) { ImageView imageView = (ImageView) view; if (imageView == null) { imageView = new ImageView(EmojiView.this.getContext()) { public void onMeasure(int paramAnonymousInt1, int paramAnonymousInt2) { setMeasuredDimension( View.MeasureSpec.getSize(paramAnonymousInt1), View.MeasureSpec.getSize(paramAnonymousInt1)); } }; imageView.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { if (EmojiView.this.listener != null) { EmojiView.this.listener.onEmojiSelected( EmojiView.this.convert((Long) view.getTag())); } EmojiView.this.addToRecent((Long) view.getTag()); } }); imageView.setBackgroundResource(R.drawable.list_selector); imageView.setScaleType(ImageView.ScaleType.CENTER); } imageView.setImageDrawable(Emoji.getEmojiBigDrawable(data[i])); imageView.setTag(data[i]); return imageView; }
public static void main(String[] args) throws Exception { byte[] bytes = hexStrToBytes("D83DDC08"); String s = new String(bytes, "utf-16"); System.out.println(strToUnicode(s)); System.out.println("aa" + s.replaceAll(Emoji.emoji(0x1F408), "")); }