本文整理汇总了Java中com.hyphenate.easeui.EaseConstant.CHATTYPE_SINGLE属性的典型用法代码示例。如果您正苦于以下问题:Java EaseConstant.CHATTYPE_SINGLE属性的具体用法?Java EaseConstant.CHATTYPE_SINGLE怎么用?Java EaseConstant.CHATTYPE_SINGLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.hyphenate.easeui.EaseConstant
的用法示例。
在下文中一共展示了EaseConstant.CHATTYPE_SINGLE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConversationType
/**
* change the chat type to EMConversationType
* @param chatType
* @return
*/
public static EMConversationType getConversationType(int chatType) {
if (chatType == EaseConstant.CHATTYPE_SINGLE) {
return EMConversationType.Chat;
} else if (chatType == EaseConstant.CHATTYPE_GROUP) {
return EMConversationType.GroupChat;
} else {
return EMConversationType.ChatRoom;
}
}
示例2: getConversationType
/**
* 将应用的会话类型转化为SDK的会话类型
* @param chatType
* @return
*/
public static EMConversationType getConversationType(int chatType) {
if (chatType == EaseConstant.CHATTYPE_SINGLE) {
return EMConversationType.Chat;
} else if (chatType == EaseConstant.CHATTYPE_GROUP) {
return EMConversationType.GroupChat;
} else {
return EMConversationType.ChatRoom;
}
}
示例3: startRedPacketActivityForResult
/**
* 进入发红包页面
*
* @param fragment
* @param chatType
* @param toChatUsername
* @param requestCode
*/
public static void startRedPacketActivityForResult(Fragment fragment, int chatType, String toChatUsername, int requestCode) {
//发送者头像url
String fromAvatarUrl = "";
//发送者昵称 设置了昵称就传昵称 否则传id
String fromNickname = "";
EaseUser easeUser = EaseUserUtils.getUserInfo(EMClient.getInstance().getCurrentUser());
if (easeUser != null) {
fromAvatarUrl = TextUtils.isEmpty(easeUser.getAvatar()) ? "none" : easeUser.getAvatar();
fromNickname = TextUtils.isEmpty(easeUser.getNick()) ? easeUser.getUsername() : easeUser.getNick();
}
RedPacketInfo redPacketInfo = new RedPacketInfo();
redPacketInfo.fromAvatarUrl = fromAvatarUrl;
redPacketInfo.fromNickName = fromNickname;
//接收者Id或者接收的群Id
if (chatType == EaseConstant.CHATTYPE_SINGLE) {
redPacketInfo.toUserId = toChatUsername;
redPacketInfo.chatType = 1;
} else if (chatType == EaseConstant.CHATTYPE_GROUP) {
EMGroup group = EMClient.getInstance().groupManager().getGroup(toChatUsername);
redPacketInfo.toGroupId = group.getGroupId();
redPacketInfo.groupMemberCount = group.getAffiliationsCount();
redPacketInfo.chatType = 2;
}
Intent intent = new Intent(fragment.getContext(), RPRedPacketActivity.class);
intent.putExtra(RPConstant.EXTRA_MONEY_INFO, redPacketInfo);
fragment.startActivityForResult(intent, requestCode);
}
示例4: 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);
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);
}
示例5: 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();
}
}
示例6: initView
/**
* 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);
}
示例7: initView
/**
* init view
*/
protected void initView() {
// hold to record voice
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);
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);
}