本文整理汇总了Java中cn.bmob.im.config.BmobConfig类的典型用法代码示例。如果您正苦于以下问题:Java BmobConfig类的具体用法?Java BmobConfig怎么用?Java BmobConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BmobConfig类属于cn.bmob.im.config包,在下文中一共展示了BmobConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showMsgNotify
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
public void showMsgNotify(Context context,BmobMsg msg) {
wakePhoneAndUnlock();
// 更新通知栏
int icon = R.mipmap.ic_launcher;
String trueMsg = "";
if(msg.getMsgType()==BmobConfig.TYPE_TEXT && msg.getContent().contains("\\ue")){
trueMsg = "[表情]";
}else if(msg.getMsgType()==BmobConfig.TYPE_IMAGE){
trueMsg = "[图片]";
}else if(msg.getMsgType()==BmobConfig.TYPE_VOICE){
trueMsg = "[语音]";
}else if(msg.getMsgType()==BmobConfig.TYPE_LOCATION){
trueMsg = "[位置]";
}else{
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongNick() + ":" + trueMsg;
String contentTitle = msg.getBelongNick()+ " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, MessageActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("isshowchat", true);
BmobNotifyManager.getInstance(context).showNotifyWithExtras(application.isVoiceAllowed, application.isVibrateAllowed,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
示例2: getDownLoadFilePath
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
public String getDownLoadFilePath(BmobMsg msg) {
String accountDir = BmobUtils.string2MD5(userManager
.getCurrentUserObjectId());
File dir = new File(BmobConfig.BMOB_VOICE_DIR + File.separator
+ accountDir + File.separator + msg.getBelongId());
if (!dir.exists()) {
dir.mkdirs();
}
// 在当前用户的目录下面存放录音文件
File audioFile = new File(dir.getAbsolutePath() + File.separator
+ msg.getMsgTime() + ".amr");
try {
if (!audioFile.exists()) {
audioFile.createNewFile();
}
} catch (IOException e) {
}
return audioFile.getAbsolutePath();
}
示例3: addFriend
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
public void addFriend(View v){
mAddFriend.setClickable(false);
Log.e("BB", "接收人ID" + mUser.getObjectId());
BmobChatManager.getInstance(this).sendTagMessage(BmobConfig.TAG_ADD_CONTACT, mUser.getObjectId(), new PushListener() {
@Override
public void onSuccess() {
ToastUtils.make(UserActivity.this, "发送请求成功,等待对方回应");
mAddFriend.setClickable(true);
}
@Override
public void onFailure(int i, String s) {
mAddFriend.setClickable(true);
ToastUtils.make(UserActivity.this, "发送请求失败,请重试");
}
});
}
示例4: getDownLoadFilePath
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
private String getDownLoadFilePath(BmobMsg msg) {
String accountDir = BmobUtils.string2MD5(userManager
.getCurrentUserObjectId());
File dir = new File(BmobConfig.BMOB_VOICE_DIR + File.separator
+ accountDir + File.separator + msg.getBelongId());
if (!dir.exists()) {
dir.mkdirs();
}
// �ڵ�ǰ�û���Ŀ¼������¼���ļ�
File audioFile = new File(dir.getAbsolutePath() + File.separator
+ msg.getMsgTime() + ".amr");
try {
if (!audioFile.exists()) {
audioFile.createNewFile();
}
} catch (IOException e) {
}
return audioFile.getAbsolutePath();
}
示例5: createViewByType
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
private View createViewByType(BmobMsg message, int position) {
int type = message.getMsgType();
if(type==BmobConfig.TYPE_IMAGE){//ͼƬ����
return getItemViewType(position) == TYPE_RECEIVER_IMAGE ?
mLayoutInflater.inflate(R.layout.item_chat_received_image, null)
:
mLayoutInflater.inflate(R.layout.item_chat_sent_image, null);
}else if(type==BmobConfig.TYPE_LOCATION){//�����
return getItemViewType(position) == TYPE_RECEIVER_LOCATION ?
mLayoutInflater.inflate(R.layout.item_chat_received_location, null)
:
mLayoutInflater.inflate(R.layout.item_chat_sent_location, null);
}else if(type==BmobConfig.TYPE_VOICE){//��������
return getItemViewType(position) == TYPE_RECEIVER_VOICE ?
mLayoutInflater.inflate(R.layout.item_chat_received_voice, null)
:
mLayoutInflater.inflate(R.layout.item_chat_sent_voice, null);
}else{//ʣ��Ĭ�ϵĶ����ı�
return getItemViewType(position) == TYPE_RECEIVER_TXT ?
mLayoutInflater.inflate(R.layout.item_chat_received_message, null)
:
mLayoutInflater.inflate(R.layout.item_chat_sent_message, null);
}
}
示例6: showResendDialog
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
/**
* �ط���Ϣ�Ի���
* @param parentView
* @param view
* @param values
*/
protected void showResendDialog(final View parentView, View view, final Object values) {
DialogTips dialog = new DialogTips(this, "ȷ���ط�����Ϣ", "ȷ��", "ȡ��", "��ʾ",
true);
// ���óɹ��¼�
dialog.SetOnSuccessListener(new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int userId) {
if (((BmobMsg) values).getMsgType() == BmobConfig.TYPE_IMAGE
|| ((BmobMsg) values).getMsgType() == BmobConfig.TYPE_VOICE) {// ͼƬ���������͵IJ���
resendFileMsg(parentView, values);
} else {
resendTextMsg(parentView, values);
}
dialogInterface.dismiss();
}
});
// ��ʾȷ�϶Ի���
dialog.show();
dialog = null;
}
示例7: addFriend
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
/**
* ��Ӻ�������
*/
private void addFriend() {
final ProgressDialog progress = new ProgressDialog(this);
progress.setMessage("�������...");
progress.setCanceledOnTouchOutside(false);
progress.show();
// ����TAG����----->��Ӻ���
BmobChatManager.getInstance(this).sendTagMessage(
BmobConfig.TAG_ADD_CONTACT, user.getObjectId(),
new PushListener() {
@Override
public void onSuccess() {
progress.dismiss();
showToast("��������ɹ����ȴ��Է���֤");
}
@Override
public void onFailure(int arg0, String arg1) {
progress.dismiss();
showToast("��������ɹ����ȴ��Է���֤");
showLog("��������ʧ��:" + arg1);
}
});
}
示例8: getDownLoadFilePath
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
public String getDownLoadFilePath(BmobMsg msg) {
String accountDir = BmobUtils.string2MD5(userManager
.getCurrentUserObjectId());
File dir = new File(BmobConfig.BMOB_VOICE_DIR + File.separator
+ accountDir + File.separator + msg.getBelongId());
if (!dir.exists()) {
dir.mkdirs();
}
// 在当前用户的目录下面存放录音文件
File audioFile = new File(dir.getAbsolutePath() + File.separator
+ msg.getMsgTime() + ".amr");
try {
if (!audioFile.exists()) {
audioFile.createNewFile();
}
} catch (IOException e) {
}
return audioFile.getAbsolutePath();
}
示例9: getItemViewType
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
@Override
public int getItemViewType(int position) {
BmobMsg msg = list.get(position);
if (msg.getMsgType() == BmobConfig.TYPE_IMAGE) {
return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_IMAGE
: TYPE_RECEIVER_IMAGE;
} else if (msg.getMsgType() == BmobConfig.TYPE_LOCATION) {
return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_LOCATION
: TYPE_RECEIVER_LOCATION;
} else if (msg.getMsgType() == BmobConfig.TYPE_VOICE) {
return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_VOICE
: TYPE_RECEIVER_VOICE;
} else {
return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_TXT
: TYPE_RECEIVER_TXT;
}
}
示例10: createViewByType
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
@SuppressLint("InflateParams")
private View createViewByType(BmobMsg message, int position) {
int type = message.getMsgType();
if (type == BmobConfig.TYPE_IMAGE) {// 图片类型
return getItemViewType(position) == TYPE_RECEIVER_IMAGE ? mInflater
.inflate(R.layout.item_chat_received_image, null)
: mInflater.inflate(R.layout.item_chat_sent_image, null);
} else if (type == BmobConfig.TYPE_LOCATION) {// 位置类型
return getItemViewType(position) == TYPE_RECEIVER_LOCATION ? mInflater
.inflate(R.layout.item_chat_received_location, null)
: mInflater.inflate(R.layout.item_chat_sent_location, null);
} else if (type == BmobConfig.TYPE_VOICE) {// 语音类型
return getItemViewType(position) == TYPE_RECEIVER_VOICE ? mInflater
.inflate(R.layout.item_chat_received_voice, null)
: mInflater.inflate(R.layout.item_chat_sent_voice, null);
} else {// 剩下默认的都是文本
return getItemViewType(position) == TYPE_RECEIVER_TXT ? mInflater
.inflate(R.layout.item_chat_received_message, null)
: mInflater.inflate(R.layout.item_chat_sent_message, null);
}
}
示例11: getDownLoadFilePath
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
public String getDownLoadFilePath(BmobMsg msg) {
String accountDir = BmobUtils.string2MD5(userManager
.getCurrentUserObjectId());
File dir = new File(BmobConfig.BMOB_VOICE_DIR + File.separator
+ accountDir + File.separator + msg.getBelongId());
if (!dir.exists()) {
dir.mkdirs();
}
// �ڵ�ǰ�û���Ŀ¼������¼���ļ�
File audioFile = new File(dir.getAbsolutePath() + File.separator
+ msg.getMsgTime() + ".amr");
try {
if (!audioFile.exists()) {
audioFile.createNewFile();
}
} catch (IOException e) {
}
return audioFile.getAbsolutePath();
}
示例12: createViewByType
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
private View createViewByType(BmobMsg message, int position) {
int type = message.getMsgType();
if(type==BmobConfig.TYPE_IMAGE){
return getItemViewType(position) == TYPE_RECEIVER_IMAGE ?
mInflater.inflate(R.layout.item_chat_received_image, null)
:
mInflater.inflate(R.layout.item_chat_sent_image, null);
}else if(type==BmobConfig.TYPE_LOCATION){
return getItemViewType(position) == TYPE_RECEIVER_LOCATION ?
mInflater.inflate(R.layout.item_chat_received_location, null)
:
mInflater.inflate(R.layout.item_chat_sent_location, null);
}else if(type==BmobConfig.TYPE_VOICE){
return getItemViewType(position) == TYPE_RECEIVER_VOICE ?
mInflater.inflate(R.layout.item_chat_received_voice, null)
:
mInflater.inflate(R.layout.item_chat_sent_voice, null);
}else{
return getItemViewType(position) == TYPE_RECEIVER_TXT ?
mInflater.inflate(R.layout.item_chat_received_message, null)
:
mInflater.inflate(R.layout.item_chat_sent_message, null);
}
}
示例13: showResendDialog
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
/**
* showResendDialog
* @Title: showResendDialog
* @Description: TODO
* @param @param recent
* @return void
* @throws
*/
public void showResendDialog(final View parentV, View v, final Object values) {
DialogTips dialog = new DialogTips(this, "重新发送该消息", "是", "不", "提示",
true);
// ���óɹ��¼�
dialog.SetOnSuccessListener(new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int userId) {
if (((BmobMsg) values).getMsgType() == BmobConfig.TYPE_IMAGE
|| ((BmobMsg) values).getMsgType() == BmobConfig.TYPE_VOICE) {// ͼƬ���������͵IJ���
resendFileMsg(parentV, values);
} else {
resendTextMsg(parentV, values);
}
dialogInterface.dismiss();
}
});
dialog.show();
dialog = null;
}
示例14: addFriend
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
/**
* ��Ӻ�������
*
* @Title: addFriend
* @Description: TODO
* @param
* @return void
* @throws
*/
private void addFriend() {
final ProgressDialog progress = new ProgressDialog(this);
progress.setMessage("正在添加...");
progress.setCanceledOnTouchOutside(false);
progress.show();
BmobChatManager.getInstance(this).sendTagMessage(BmobConfig.TAG_ADD_CONTACT,
user.getObjectId(), new PushListener() {
@Override
public void onSuccess() {
// TODO Auto-generated method stub
progress.dismiss();
ShowToast("发送请求成功,等待对方验证!");
}
@Override
public void onFailure(int arg0, final String arg1) {
// TODO Auto-generated method stub
progress.dismiss();
ShowToast("发送请求成功,等待对方验证!");
ShowLog("发送请求失败:" + arg1);
}
});
}
示例15: createViewByType
import cn.bmob.im.config.BmobConfig; //导入依赖的package包/类
private View createViewByType(BmobMsg message, int position) {
int type = message.getMsgType();
if(type==BmobConfig.TYPE_IMAGE){//ͼƬ����
return getItemViewType(position) == TYPE_RECEIVER_IMAGE ?
mInflater.inflate(R.layout.item_chat_received_image, null)
:
mInflater.inflate(R.layout.item_chat_sent_image, null);
}else if(type==BmobConfig.TYPE_LOCATION){//�����
return getItemViewType(position) == TYPE_RECEIVER_LOCATION ?
mInflater.inflate(R.layout.item_chat_received_location, null)
:
mInflater.inflate(R.layout.item_chat_sent_location, null);
}else if(type==BmobConfig.TYPE_VOICE){//��������
return getItemViewType(position) == TYPE_RECEIVER_VOICE ?
mInflater.inflate(R.layout.item_chat_received_voice, null)
:
mInflater.inflate(R.layout.item_chat_sent_voice, null);
}else{//ʣ��Ĭ�ϵĶ����ı�
return getItemViewType(position) == TYPE_RECEIVER_TXT ?
mInflater.inflate(R.layout.item_chat_received_message, null)
:
mInflater.inflate(R.layout.item_chat_sent_message, null);
}
}