use of sj.keyboard.data.EmoticonPageSetEntity in project XhsEmoticonsKeyboard by w446108264.
the class SimpleCommonUtils method addEmojiPageSetEntity.
/**
* 插入emoji表情集
*
* @param pageSetAdapter
* @param context
* @param emoticonClickListener
*/
public static void addEmojiPageSetEntity(PageSetAdapter pageSetAdapter, Context context, final EmoticonClickListener emoticonClickListener) {
ArrayList<EmojiBean> emojiArray = new ArrayList<>();
Collections.addAll(emojiArray, DefEmoticons.sEmojiArray);
EmoticonPageSetEntity emojiPageSetEntity = new EmoticonPageSetEntity.Builder().setLine(3).setRow(7).setEmoticonList(emojiArray).setIPageViewInstantiateItem(getDefaultEmoticonPageViewInstantiateItem(new EmoticonDisplayListener<Object>() {
@Override
public void onBindView(int position, ViewGroup parent, EmoticonsAdapter.ViewHolder viewHolder, Object object, final boolean isDelBtn) {
final EmojiBean emojiBean = (EmojiBean) object;
if (emojiBean == null && !isDelBtn) {
return;
}
viewHolder.ly_root.setBackgroundResource(com.keyboard.view.R.drawable.bg_emoticon);
if (isDelBtn) {
viewHolder.iv_emoticon.setImageResource(R.mipmap.icon_del);
} else {
viewHolder.iv_emoticon.setImageResource(emojiBean.icon);
}
viewHolder.rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (emoticonClickListener != null) {
emoticonClickListener.onEmoticonClick(emojiBean, Constants.EMOTICON_CLICK_TEXT, isDelBtn);
}
}
});
}
})).setShowDelBtn(EmoticonPageEntity.DelBtnStatus.LAST).setIconUri(ImageBase.Scheme.DRAWABLE.toUri("icon_emoji")).build();
pageSetAdapter.add(emojiPageSetEntity);
}
use of sj.keyboard.data.EmoticonPageSetEntity in project XhsEmoticonsKeyboard by w446108264.
the class QqUtils method addQqPageSetEntity.
public static void addQqPageSetEntity(PageSetAdapter pageSetAdapter, Context context, final EmoticonClickListener emoticonClickListener) {
EmoticonPageSetEntity kaomojiPageSetEntity = new EmoticonPageSetEntity.Builder().setLine(3).setRow(7).setEmoticonList(ParseDataUtils.ParseQqData(DefQqEmoticons.sQqEmoticonHashMap)).setIPageViewInstantiateItem(new PageViewInstantiateListener<EmoticonPageEntity>() {
@Override
public View instantiateItem(ViewGroup container, int position, EmoticonPageEntity pageEntity) {
if (pageEntity.getRootView() == null) {
EmoticonPageView pageView = new EmoticonPageView(container.getContext());
pageView.setNumColumns(pageEntity.getRow());
pageEntity.setRootView(pageView);
try {
EmoticonsAdapter adapter = new EmoticonsAdapter(container.getContext(), pageEntity, emoticonClickListener);
adapter.setItemHeightMaxRatio(1.8);
adapter.setOnDisPlayListener(getEmoticonDisplayListener(emoticonClickListener));
pageView.getEmoticonsGridView().setAdapter(adapter);
} catch (Exception e) {
e.printStackTrace();
}
}
return pageEntity.getRootView();
}
}).setShowDelBtn(EmoticonPageEntity.DelBtnStatus.LAST).setIconUri(ImageBase.Scheme.DRAWABLE.toUri("kys")).build();
pageSetAdapter.add(kaomojiPageSetEntity);
}
use of sj.keyboard.data.EmoticonPageSetEntity 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.EmoticonPageSetEntity 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.EmoticonPageSetEntity in project XhsEmoticonsKeyboard by w446108264.
the class SimpleCommonUtils method addXhsPageSetEntity.
/**
* 插入xhs表情集
*
* @param pageSetAdapter
* @param context
* @param emoticonClickListener
*/
public static void addXhsPageSetEntity(PageSetAdapter pageSetAdapter, Context context, EmoticonClickListener emoticonClickListener) {
EmoticonPageSetEntity xhsPageSetEntity = new EmoticonPageSetEntity.Builder().setLine(3).setRow(7).setEmoticonList(ParseDataUtils.ParseXhsData(DefXhsEmoticons.xhsEmoticonArray, ImageBase.Scheme.ASSETS)).setIPageViewInstantiateItem(getDefaultEmoticonPageViewInstantiateItem(getCommonEmoticonDisplayListener(emoticonClickListener, Constants.EMOTICON_CLICK_TEXT))).setShowDelBtn(EmoticonPageEntity.DelBtnStatus.LAST).setIconUri(ImageBase.Scheme.ASSETS.toUri("xhsemoji_19.png")).build();
pageSetAdapter.add(xhsPageSetEntity);
}
Aggregations