use of com.hyphenate.easeui.widget.EaseVoiceRecorderView.EaseVoiceRecorderCallback 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();
}
}
Aggregations