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);
}
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;
}
}
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);
}
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;
}
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);
}
Aggregations