本文整理匯總了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);
}
示例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);
}
示例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);
}