Search in sources :

Example 6 with EaseEmojicon

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

the class EaseEmojiconPagerView method getPageSize.

/**
 * get size of pages
 * @param emojiconList
 * @return
 */
private int getPageSize(EaseEmojiconGroupEntity groupEntity) {
    List<EaseEmojicon> emojiconList = groupEntity.getEmojiconList();
    int itemSize = emojiconColumns * emojiconRows - 1;
    int totalSize = emojiconList.size();
    Type emojiType = groupEntity.getType();
    if (emojiType == Type.BIG_EXPRESSION) {
        itemSize = bigEmojiconColumns * bigEmojiconRows;
    }
    int pageSize = totalSize % itemSize == 0 ? totalSize / itemSize : totalSize / itemSize + 1;
    return pageSize;
}
Also used : Type(com.hyphenate.easeui.domain.EaseEmojicon.Type) EaseEmojicon(com.hyphenate.easeui.domain.EaseEmojicon)

Example 7 with EaseEmojicon

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

the class EaseChatFragment method initView.

/**
 * init view
 */
protected void initView() {
    // hold to record voice
    // noinspection ConstantConditions
    voiceRecorderView = (EaseVoiceRecorderView) getView().findViewById(R.id.voice_recorder);
    // message list layout
    messageList = (EaseChatMessageList) getView().findViewById(R.id.message_list);
    if (chatType != EaseConstant.CHATTYPE_SINGLE)
        messageList.setShowUserNick(true);
    // messageList.setAvatarShape(1);
    listView = messageList.getListView();
    extendMenuItemClickListener = new MyItemClickListener();
    inputMenu = (EaseChatInputMenu) getView().findViewById(R.id.input_menu);
    registerExtendMenuItem();
    // init input menu
    inputMenu.init(null);
    inputMenu.setChatInputMenuListener(new ChatInputMenuListener() {

        @Override
        public void onSendMessage(String content) {
            sendTextMessage(content);
        }

        @Override
        public boolean onPressToSpeakBtnTouch(View v, MotionEvent event) {
            return voiceRecorderView.onPressToSpeakBtnTouch(v, event, new EaseVoiceRecorderCallback() {

                @Override
                public void onVoiceRecordComplete(String voiceFilePath, int voiceTimeLength) {
                    sendVoiceMessage(voiceFilePath, voiceTimeLength);
                }
            });
        }

        @Override
        public void onBigExpressionClicked(EaseEmojicon emojicon) {
            sendBigExpressionMessage(emojicon.getName(), emojicon.getIdentityCode());
        }
    });
    swipeRefreshLayout = messageList.getSwipeRefreshLayout();
    swipeRefreshLayout.setColorSchemeResources(R.color.holo_blue_bright, R.color.holo_green_light, R.color.holo_orange_light, R.color.holo_red_light);
    inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
    clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    if (isRoaming) {
        fetchQueue = Executors.newSingleThreadExecutor();
    }
}
Also used : EaseVoiceRecorderCallback(com.hyphenate.easeui.widget.EaseVoiceRecorderView.EaseVoiceRecorderCallback) EaseEmojicon(com.hyphenate.easeui.domain.EaseEmojicon) ChatInputMenuListener(com.hyphenate.easeui.widget.EaseChatInputMenu.ChatInputMenuListener) View(android.view.View) ListView(android.widget.ListView) EaseVoiceRecorderView(com.hyphenate.easeui.widget.EaseVoiceRecorderView) MotionEvent(android.view.MotionEvent)

Aggregations

EaseEmojicon (com.hyphenate.easeui.domain.EaseEmojicon)7 View (android.view.View)4 MotionEvent (android.view.MotionEvent)2 AdapterView (android.widget.AdapterView)2 GridView (android.widget.GridView)2 Type (com.hyphenate.easeui.domain.EaseEmojicon.Type)2 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 EmojiconGridAdapter (com.hyphenate.easeui.adapter.EmojiconGridAdapter)1 EmojiconPagerAdapter (com.hyphenate.easeui.adapter.EmojiconPagerAdapter)1 EaseEmojiconGroupEntity (com.hyphenate.easeui.domain.EaseEmojiconGroupEntity)1 ChatInputMenuListener (com.hyphenate.easeui.widget.EaseChatInputMenu.ChatInputMenuListener)1 EaseChatPrimaryMenuListener (com.hyphenate.easeui.widget.EaseChatPrimaryMenuBase.EaseChatPrimaryMenuListener)1 EaseVoiceRecorderView (com.hyphenate.easeui.widget.EaseVoiceRecorderView)1 EaseVoiceRecorderCallback (com.hyphenate.easeui.widget.EaseVoiceRecorderView.EaseVoiceRecorderCallback)1 EaseEmojiconMenuListener (com.hyphenate.easeui.widget.emojicon.EaseEmojiconMenuBase.EaseEmojiconMenuListener)1 ArrayList (java.util.ArrayList)1