Search in sources :

Example 1 with EaseEmojiconGroupEntity

use of com.hyphenate.easeui.domain.EaseEmojiconGroupEntity in project SmartCampus by Vegen.

the class EaseEmojiconPagerView method init.

public void init(List<EaseEmojiconGroupEntity> emojiconGroupList, int emijiconColumns, int bigEmojiconColumns) {
    if (emojiconGroupList == null) {
        throw new RuntimeException("emojiconGroupList is null");
    }
    this.groupEntities = emojiconGroupList;
    this.emojiconColumns = emijiconColumns;
    this.bigEmojiconColumns = bigEmojiconColumns;
    viewpages = new ArrayList<View>();
    for (int i = 0; i < groupEntities.size(); i++) {
        EaseEmojiconGroupEntity group = groupEntities.get(i);
        List<EaseEmojicon> groupEmojicons = group.getEmojiconList();
        List<View> gridViews = getGroupGridViews(group);
        if (i == 0) {
            firstGroupPageSize = gridViews.size();
        }
        maxPageCount = Math.max(gridViews.size(), maxPageCount);
        viewpages.addAll(gridViews);
    }
    pagerAdapter = new EmojiconPagerAdapter(viewpages);
    setAdapter(pagerAdapter);
    setOnPageChangeListener(new EmojiPagerChangeListener());
    if (pagerViewListener != null) {
        pagerViewListener.onPagerViewInited(maxPageCount, firstGroupPageSize);
    }
}
Also used : EmojiconPagerAdapter(com.hyphenate.easeui.adapter.EmojiconPagerAdapter) EaseEmojiconGroupEntity(com.hyphenate.easeui.domain.EaseEmojiconGroupEntity) EaseEmojicon(com.hyphenate.easeui.domain.EaseEmojicon) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 2 with EaseEmojiconGroupEntity

use of com.hyphenate.easeui.domain.EaseEmojiconGroupEntity in project SmartCampus by Vegen.

the class EaseEmojiconMenu method init.

public void init(List<EaseEmojiconGroupEntity> groupEntities) {
    if (groupEntities == null || groupEntities.size() == 0) {
        return;
    }
    for (EaseEmojiconGroupEntity groupEntity : groupEntities) {
        emojiconGroupList.add(groupEntity);
        tabBar.addTab(groupEntity.getIcon());
    }
    pagerView.setPagerViewListener(new EmojiconPagerViewListener());
    pagerView.init(emojiconGroupList, emojiconColumns, bigEmojiconColumns);
    tabBar.setTabBarItemClickListener(new EaseScrollTabBarItemClickListener() {

        @Override
        public void onItemClick(int position) {
            pagerView.setGroupPostion(position);
        }
    });
}
Also used : EaseScrollTabBarItemClickListener(com.hyphenate.easeui.widget.emojicon.EaseEmojiconScrollTabBar.EaseScrollTabBarItemClickListener) EaseEmojiconGroupEntity(com.hyphenate.easeui.domain.EaseEmojiconGroupEntity) EaseEmojiconPagerViewListener(com.hyphenate.easeui.widget.emojicon.EaseEmojiconPagerView.EaseEmojiconPagerViewListener)

Example 3 with EaseEmojiconGroupEntity

use of com.hyphenate.easeui.domain.EaseEmojiconGroupEntity in project SmartCampus by Vegen.

the class EaseEmojiconMenu method addEmojiconGroup.

/**
 * add emojicon group list
 * @param groupEntitieList
 */
public void addEmojiconGroup(List<EaseEmojiconGroupEntity> groupEntitieList) {
    for (int i = 0; i < groupEntitieList.size(); i++) {
        EaseEmojiconGroupEntity groupEntity = groupEntitieList.get(i);
        emojiconGroupList.add(groupEntity);
        pagerView.addEmojiconGroup(groupEntity, i == groupEntitieList.size() - 1 ? true : false);
        tabBar.addTab(groupEntity.getIcon());
    }
}
Also used : EaseEmojiconGroupEntity(com.hyphenate.easeui.domain.EaseEmojiconGroupEntity)

Example 4 with EaseEmojiconGroupEntity

use of com.hyphenate.easeui.domain.EaseEmojiconGroupEntity in project SmartCampus by Vegen.

the class EaseChatInputMenu method init.

/**
 * init view
 *
 * This method should be called after registerExtendMenuItem(), setCustomEmojiconMenu() and setCustomPrimaryMenu().
 * @param emojiconGroupList --will use default if null
 */
@SuppressLint("InflateParams")
public void init(List<EaseEmojiconGroupEntity> emojiconGroupList) {
    if (inited) {
        return;
    }
    // primary menu, use default if no customized one
    if (chatPrimaryMenu == null) {
        chatPrimaryMenu = (EaseChatPrimaryMenu) layoutInflater.inflate(R.layout.ease_layout_chat_primary_menu, null);
    }
    primaryMenuContainer.addView(chatPrimaryMenu);
    // emojicon menu, use default if no customized one
    if (emojiconMenu == null) {
        emojiconMenu = (EaseEmojiconMenu) layoutInflater.inflate(R.layout.ease_layout_emojicon_menu, null);
        if (emojiconGroupList == null) {
            emojiconGroupList = new ArrayList<EaseEmojiconGroupEntity>();
            emojiconGroupList.add(new EaseEmojiconGroupEntity(R.drawable.ee_1, Arrays.asList(EaseDefaultEmojiconDatas.getData())));
        }
        ((EaseEmojiconMenu) emojiconMenu).init(emojiconGroupList);
    }
    emojiconMenuContainer.addView(emojiconMenu);
    processChatMenu();
    chatExtendMenu.init();
    inited = true;
}
Also used : EaseEmojiconGroupEntity(com.hyphenate.easeui.domain.EaseEmojiconGroupEntity) EaseEmojiconMenu(com.hyphenate.easeui.widget.emojicon.EaseEmojiconMenu) SuppressLint(android.annotation.SuppressLint)

Aggregations

EaseEmojiconGroupEntity (com.hyphenate.easeui.domain.EaseEmojiconGroupEntity)4 SuppressLint (android.annotation.SuppressLint)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 GridView (android.widget.GridView)1 EmojiconPagerAdapter (com.hyphenate.easeui.adapter.EmojiconPagerAdapter)1 EaseEmojicon (com.hyphenate.easeui.domain.EaseEmojicon)1 EaseEmojiconMenu (com.hyphenate.easeui.widget.emojicon.EaseEmojiconMenu)1 EaseEmojiconPagerViewListener (com.hyphenate.easeui.widget.emojicon.EaseEmojiconPagerView.EaseEmojiconPagerViewListener)1 EaseScrollTabBarItemClickListener (com.hyphenate.easeui.widget.emojicon.EaseEmojiconScrollTabBar.EaseScrollTabBarItemClickListener)1