use of sj.keyboard.data.EmoticonEntity in project XhsEmoticonsKeyboard by w446108264.
the class SimpleCommonUtils method addWechatPageSetEntity.
/**
* 插入微信表情集
*
* @param pageSetAdapter
* @param context
* @param emoticonClickListener
*/
public static void addWechatPageSetEntity(PageSetAdapter pageSetAdapter, Context context, EmoticonClickListener emoticonClickListener) {
String filePath = FileUtils.getFolderPath("wxemoticons");
EmoticonPageSetEntity<EmoticonEntity> emoticonPageSetEntity = ParseDataUtils.parseDataFromFile(context, filePath, "wxemoticons.zip", "wxemoticons.xml");
if (emoticonPageSetEntity == null) {
return;
}
EmoticonPageSetEntity pageSetEntity = new EmoticonPageSetEntity.Builder().setLine(emoticonPageSetEntity.getLine()).setRow(emoticonPageSetEntity.getRow()).setEmoticonList(emoticonPageSetEntity.getEmoticonList()).setIPageViewInstantiateItem(getEmoticonPageViewInstantiateItem(BigEmoticonsAdapter.class, emoticonClickListener)).setIconUri(ImageBase.Scheme.FILE.toUri(filePath + "/" + emoticonPageSetEntity.getIconUri())).build();
pageSetAdapter.add(pageSetEntity);
}
use of sj.keyboard.data.EmoticonEntity in project XhsEmoticonsKeyboard by w446108264.
the class SimpleCommonUtils method addGoodGoodStudyPageSetEntity.
/**
* 插入我们爱学习表情集
*
* @param pageSetAdapter
* @param context
* @param emoticonClickListener
*/
public static void addGoodGoodStudyPageSetEntity(PageSetAdapter pageSetAdapter, Context context, EmoticonClickListener emoticonClickListener) {
String filePath = FileUtils.getFolderPath("goodgoodstudy");
EmoticonPageSetEntity<EmoticonEntity> emoticonPageSetEntity = ParseDataUtils.parseDataFromFile(context, filePath, "goodgoodstudy.zip", "goodgoodstudy.xml");
if (emoticonPageSetEntity == null) {
return;
}
EmoticonPageSetEntity pageSetEntity = new EmoticonPageSetEntity.Builder().setLine(emoticonPageSetEntity.getLine()).setRow(emoticonPageSetEntity.getRow()).setEmoticonList(emoticonPageSetEntity.getEmoticonList()).setIPageViewInstantiateItem(getEmoticonPageViewInstantiateItem(BigEmoticonsAndTitleAdapter.class, emoticonClickListener)).setIconUri(ImageBase.Scheme.FILE.toUri(filePath + "/" + emoticonPageSetEntity.getIconUri())).build();
pageSetAdapter.add(pageSetEntity);
}
use of sj.keyboard.data.EmoticonEntity in project XhsEmoticonsKeyboard by w446108264.
the class BigEmoticonsAdapter method bindView.
protected void bindView(int position, ViewHolder viewHolder) {
final boolean isDelBtn = isDelBtn(position);
final EmoticonEntity emoticonEntity = mData.get(position);
if (isDelBtn) {
viewHolder.iv_emoticon.setImageResource(R.mipmap.icon_del);
viewHolder.iv_emoticon.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
} else {
if (emoticonEntity != null) {
try {
ImageLoader.getInstance(viewHolder.iv_emoticon.getContext()).displayImage(emoticonEntity.getIconUri(), viewHolder.iv_emoticon);
} catch (IOException e) {
e.printStackTrace();
}
viewHolder.iv_emoticon.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
}
}
viewHolder.rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnEmoticonClickListener != null) {
mOnEmoticonClickListener.onEmoticonClick(emoticonEntity, Constants.EMOTICON_CLICK_BIGIMAGE, isDelBtn);
}
}
});
}
use of sj.keyboard.data.EmoticonEntity in project XhsEmoticonsKeyboard by w446108264.
the class BigEmoticonsAndTitleAdapter method bindView.
protected void bindView(int position, ViewHolder viewHolder) {
final boolean isDelBtn = isDelBtn(position);
final EmoticonEntity emoticonEntity = mData.get(position);
if (isDelBtn) {
viewHolder.iv_emoticon.setImageResource(R.mipmap.icon_del);
viewHolder.iv_emoticon.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
} else {
if (emoticonEntity != null) {
try {
ImageLoadUtils.getInstance(viewHolder.iv_emoticon.getContext()).displayImage(emoticonEntity.getIconUri(), viewHolder.iv_emoticon);
viewHolder.tv_content.setVisibility(View.VISIBLE);
viewHolder.tv_content.setText(emoticonEntity.getContent());
} catch (IOException e) {
e.printStackTrace();
}
viewHolder.iv_emoticon.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
}
}
viewHolder.rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnEmoticonClickListener != null) {
mOnEmoticonClickListener.onEmoticonClick(emoticonEntity, Constants.EMOTICON_CLICK_BIGIMAGE, isDelBtn);
}
}
});
}
use of sj.keyboard.data.EmoticonEntity in project XhsEmoticonsKeyboard by w446108264.
the class TextEmoticonsAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_emoticon_text, null);
viewHolder.rootView = convertView;
viewHolder.ly_root = (LinearLayout) convertView.findViewById(R.id.ly_root);
viewHolder.tv_content = (TextView) convertView.findViewById(R.id.tv_content);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
final boolean isDelBtn = isDelBtn(position);
final EmoticonEntity emoticonEntity = mData.get(position);
if (isDelBtn) {
viewHolder.ly_root.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
} else {
viewHolder.tv_content.setVisibility(View.VISIBLE);
if (emoticonEntity != null) {
viewHolder.tv_content.setText(emoticonEntity.getContent());
viewHolder.ly_root.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
}
}
viewHolder.rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnEmoticonClickListener != null) {
mOnEmoticonClickListener.onEmoticonClick(emoticonEntity, Constants.EMOTICON_CLICK_TEXT, isDelBtn);
}
}
});
updateUI(viewHolder, parent);
return convertView;
}
Aggregations