Search in sources :

Example 1 with PageSetEntity

use of sj.keyboard.data.PageSetEntity in project XhsEmoticonsKeyboard by w446108264.

the class SimpleCommonUtils method addTestPageSetEntity.

/**
     * 测试页集
     *
     * @param pageSetAdapter
     * @param context
     */
public static void addTestPageSetEntity(PageSetAdapter pageSetAdapter, Context context) {
    PageSetEntity pageSetEntity = new PageSetEntity.Builder().addPageEntity(new PageEntity(new SimpleAppsGridView(context))).setIconUri(ImageBase.Scheme.DRAWABLE.toUri("icon_kaomoji")).setShowIndicator(false).build();
    pageSetAdapter.add(pageSetEntity);
}
Also used : PageEntity(sj.keyboard.data.PageEntity) EmoticonPageEntity(sj.keyboard.data.EmoticonPageEntity) SimpleAppsGridView(com.xhsemoticonskeyboard.common.widget.SimpleAppsGridView) SpannableStringBuilder(android.text.SpannableStringBuilder) PageSetEntity(sj.keyboard.data.PageSetEntity) EmoticonPageSetEntity(sj.keyboard.data.EmoticonPageSetEntity)

Example 2 with PageSetEntity

use of sj.keyboard.data.PageSetEntity in project XhsEmoticonsKeyboard by w446108264.

the class EmoticonsFuncView method checkPageChange.

public void checkPageChange(int position) {
    if (mPageSetAdapter == null) {
        return;
    }
    int end = 0;
    for (PageSetEntity pageSetEntity : mPageSetAdapter.getPageSetEntityList()) {
        int size = pageSetEntity.getPageCount();
        if (end + size > position) {
            boolean isEmoticonSetChanged = true;
            // 上一表情集
            if (mCurrentPagePosition - end >= size) {
                if (mOnEmoticonsPageViewListener != null) {
                    mOnEmoticonsPageViewListener.playTo(position - end, pageSetEntity);
                }
            } else // 下一表情集
            if (mCurrentPagePosition - end < 0) {
                if (mOnEmoticonsPageViewListener != null) {
                    mOnEmoticonsPageViewListener.playTo(0, pageSetEntity);
                }
            } else // 当前表情集
            {
                if (mOnEmoticonsPageViewListener != null) {
                    mOnEmoticonsPageViewListener.playBy(mCurrentPagePosition - end, position - end, pageSetEntity);
                }
                isEmoticonSetChanged = false;
            }
            if (isEmoticonSetChanged && mOnEmoticonsPageViewListener != null) {
                mOnEmoticonsPageViewListener.emoticonSetChanged(pageSetEntity);
            }
            return;
        }
        end += size;
    }
}
Also used : PageSetEntity(sj.keyboard.data.PageSetEntity)

Example 3 with PageSetEntity

use of sj.keyboard.data.PageSetEntity in project XhsEmoticonsKeyboard by w446108264.

the class EmoticonsFuncView method setAdapter.

public void setAdapter(PageSetAdapter adapter) {
    super.setAdapter(adapter);
    this.mPageSetAdapter = adapter;
    setOnPageChangeListener(new OnPageChangeListener() {

        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {
            checkPageChange(position);
            mCurrentPagePosition = position;
        }

        @Override
        public void onPageScrollStateChanged(int state) {
        }
    });
    if (mOnEmoticonsPageViewListener == null || mPageSetAdapter.getPageSetEntityList().isEmpty()) {
        return;
    }
    PageSetEntity pageSetEntity = mPageSetAdapter.getPageSetEntityList().get(0);
    mOnEmoticonsPageViewListener.playTo(0, pageSetEntity);
    mOnEmoticonsPageViewListener.emoticonSetChanged(pageSetEntity);
}
Also used : PageSetEntity(sj.keyboard.data.PageSetEntity)

Example 4 with PageSetEntity

use of sj.keyboard.data.PageSetEntity in project XhsEmoticonsKeyboard by w446108264.

the class QqUtils method getCommonAdapter.

public static PageSetAdapter getCommonAdapter(Context context, EmoticonClickListener emoticonClickListener) {
    if (sCommonPageSetAdapter != null) {
        return sCommonPageSetAdapter;
    }
    PageSetAdapter pageSetAdapter = new PageSetAdapter();
    addQqPageSetEntity(pageSetAdapter, context, emoticonClickListener);
    PageSetEntity pageSetEntity1 = new PageSetEntity.Builder().addPageEntity(new PageEntity(new SimpleQqGridView(context))).setIconUri(R.mipmap.dec).setShowIndicator(false).build();
    pageSetAdapter.add(pageSetEntity1);
    PageSetEntity pageSetEntity2 = new PageSetEntity.Builder().addPageEntity(new PageEntity(new SimpleQqGridView(context))).setIconUri(R.mipmap.mwi).setShowIndicator(false).build();
    pageSetAdapter.add(pageSetEntity2);
    return pageSetAdapter;
}
Also used : PageEntity(sj.keyboard.data.PageEntity) EmoticonPageEntity(sj.keyboard.data.EmoticonPageEntity) SpannableStringBuilder(android.text.SpannableStringBuilder) PageSetAdapter(sj.keyboard.adpater.PageSetAdapter) PageSetEntity(sj.keyboard.data.PageSetEntity) EmoticonPageSetEntity(sj.keyboard.data.EmoticonPageSetEntity)

Example 5 with PageSetEntity

use of sj.keyboard.data.PageSetEntity in project XhsEmoticonsKeyboard by w446108264.

the class PageSetAdapter method add.

public void add(int index, View view) {
    PageSetEntity pageSetEntity = new PageSetEntity.Builder().addPageEntity(new PageEntity(view)).setShowIndicator(false).build();
    mPageSetEntityList.add(index, pageSetEntity);
}
Also used : PageEntity(sj.keyboard.data.PageEntity) PageSetEntity(sj.keyboard.data.PageSetEntity)

Aggregations

PageSetEntity (sj.keyboard.data.PageSetEntity)5 PageEntity (sj.keyboard.data.PageEntity)3 SpannableStringBuilder (android.text.SpannableStringBuilder)2 EmoticonPageEntity (sj.keyboard.data.EmoticonPageEntity)2 EmoticonPageSetEntity (sj.keyboard.data.EmoticonPageSetEntity)2 SimpleAppsGridView (com.xhsemoticonskeyboard.common.widget.SimpleAppsGridView)1 PageSetAdapter (sj.keyboard.adpater.PageSetAdapter)1