當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。