当前位置: 首页>>代码示例>>Java>>正文


Java EaseVoiceRecorderView类代码示例

本文整理汇总了Java中com.easemob.easeui.widget.EaseVoiceRecorderView的典型用法代码示例。如果您正苦于以下问题:Java EaseVoiceRecorderView类的具体用法?Java EaseVoiceRecorderView怎么用?Java EaseVoiceRecorderView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EaseVoiceRecorderView类属于com.easemob.easeui.widget包,在下文中一共展示了EaseVoiceRecorderView类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initView

import com.easemob.easeui.widget.EaseVoiceRecorderView; //导入依赖的package包/类
/**
 * init view
 */
protected void initView() {
    // 按住说话录音控件
    voiceRecorderView = (EaseVoiceRecorderView) getView().findViewById(R.id.voice_recorder);

    // 消息列表layout
    messageList = (EaseChatMessageList) getView().findViewById(R.id.message_list);
    if(chatType != EaseConstant.CHATTYPE_SINGLE)
        messageList.setShowUserNick(true);
    listView = messageList.getListView();

    extendMenuItemClickListener = new MyItemClickListener();
    inputMenu = (EaseChatInputMenu) getView().findViewById(R.id.input_menu);
    registerExtendMenuItem();
    // 设置按住说话控件
    inputMenu.init();
    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);
                }
            });
        }
    });

    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);
}
 
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:48,代码来源:EaseChatFragment.java

示例2: initView

import com.easemob.easeui.widget.EaseVoiceRecorderView; //导入依赖的package包/类
/**
 * init view
 */
protected void initView() {
    // 按住说话录音控件
    voiceRecorderView = (EaseVoiceRecorderView) getView().findViewById(R.id.voice_recorder);

    // 消息列表layout
    messageList = (EaseChatMessageList) getView().findViewById(R.id.message_list);
    if(chatType != EaseConstant.CHATTYPE_SINGLE)
        messageList.setShowUserNick(true);
    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);
}
 
开发者ID:easemob,项目名称:easeui,代码行数:54,代码来源:EaseChatFragment.java

示例3: initView

import com.easemob.easeui.widget.EaseVoiceRecorderView; //导入依赖的package包/类
/**
 * init view
 */
protected void initView() {
    // 按住说话录音控件
    voiceRecorderView = (EaseVoiceRecorderView) getView().findViewById(R.id.voice_recorder);

    // 消息列表layout
    messageList = (EaseChatMessageList) getView().findViewById(R.id.message_list);
    if (chatType != EaseConstant.CHATTYPE_SINGLE)
        messageList.setShowUserNick(true);
    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);
}
 
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:54,代码来源:EaseChatFragment.java


注:本文中的com.easemob.easeui.widget.EaseVoiceRecorderView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。