Search in sources :

Example 6 with EmoticonEntity

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);
}
Also used : SpannableStringBuilder(android.text.SpannableStringBuilder) EmoticonEntity(sj.keyboard.data.EmoticonEntity) BigEmoticonsAdapter(com.xhsemoticonskeyboard.common.adapter.emoticonadapter.BigEmoticonsAdapter) EmoticonPageSetEntity(sj.keyboard.data.EmoticonPageSetEntity)

Example 7 with EmoticonEntity

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);
}
Also used : BigEmoticonsAndTitleAdapter(com.xhsemoticonskeyboard.common.adapter.emoticonadapter.BigEmoticonsAndTitleAdapter) SpannableStringBuilder(android.text.SpannableStringBuilder) EmoticonEntity(sj.keyboard.data.EmoticonEntity) EmoticonPageSetEntity(sj.keyboard.data.EmoticonPageSetEntity)

Example 8 with EmoticonEntity

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);
            }
        }
    });
}
Also used : EmoticonEntity(sj.keyboard.data.EmoticonEntity) IOException(java.io.IOException) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 9 with EmoticonEntity

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);
            }
        }
    });
}
Also used : EmoticonEntity(sj.keyboard.data.EmoticonEntity) IOException(java.io.IOException) View(android.view.View)

Example 10 with EmoticonEntity

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;
}
Also used : EmoticonEntity(sj.keyboard.data.EmoticonEntity) TextView(android.widget.TextView) View(android.view.View)

Aggregations

EmoticonEntity (sj.keyboard.data.EmoticonEntity)13 IOException (java.io.IOException)7 View (android.view.View)5 TextView (android.widget.TextView)4 ArrayList (java.util.ArrayList)4 EmoticonPageSetEntity (sj.keyboard.data.EmoticonPageSetEntity)3 Editable (android.text.Editable)2 SpannableStringBuilder (android.text.SpannableStringBuilder)2 ViewGroup (android.view.ViewGroup)2 EmojiBean (com.sj.emoji.EmojiBean)2 EmoticonClickListener (sj.keyboard.interfaces.EmoticonClickListener)2 EmoticonDisplayListener (sj.keyboard.interfaces.EmoticonDisplayListener)2 EmoticonPageView (sj.keyboard.widget.EmoticonPageView)2 ImageView (android.widget.ImageView)1 BigEmoticonsAdapter (com.xhsemoticonskeyboard.common.adapter.emoticonadapter.BigEmoticonsAdapter)1 BigEmoticonsAndTitleAdapter (com.xhsemoticonskeyboard.common.adapter.emoticonadapter.BigEmoticonsAndTitleAdapter)1 SimpleAppsGridView (com.xhsemoticonskeyboard.common.widget.SimpleAppsGridView)1 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 HashMap (java.util.HashMap)1