本文整理汇总了Java中cn.bmob.im.config.BmobConfig.TYPE_LOCATION属性的典型用法代码示例。如果您正苦于以下问题:Java BmobConfig.TYPE_LOCATION属性的具体用法?Java BmobConfig.TYPE_LOCATION怎么用?Java BmobConfig.TYPE_LOCATION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cn.bmob.im.config.BmobConfig
的用法示例。
在下文中一共展示了BmobConfig.TYPE_LOCATION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showMsgNotify
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: createViewByType
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);
}
}
示例3: getItemViewType
@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;
}
}
示例4: createViewByType
@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);
}
}
示例5: createViewByType
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);
}
}
示例6: createViewByType
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);
}
}
示例7: createViewByType
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);
}
}
示例8: createViewByType
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);
}
}
示例9: showMsgNotify
/**
* ��ʾ��������Ϣ��֪ͨ
*
* @param context
* @param msg
*/
protected void showMsgNotify(Context context, BmobMsg msg) {
// ����֪ͨ��
int icon = R.drawable.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.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "������Ϣ)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplication.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
示例10: getItemViewType
@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;
}
}
示例11: showMsgNotify
/**
* 显示与聊天消息的通知
*
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context, BmobMsg msg) {
// 更新通知栏
int icon = R.drawable.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.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername() + " (" + mNewNum
+ "条新消息)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil()
.isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil()
.isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(
isAllowVoice, isAllowVibrate, icon, tickerText.toString(),
contentTitle, tickerText.toString(), intent);
}
示例12: showMsgNotify
/**
* ��ʾ��������Ϣ��֪ͨ
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context,BmobMsg msg) {
int icon = R.drawable.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.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
示例13: showMsgNotify
/**
* ��ʾ��������Ϣ��֪ͨ
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context,BmobMsg msg) {
// ����֪ͨ��
int icon = R.drawable.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.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "������Ϣ)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplication.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
示例14: showMsgNotify
/**
* 显示与聊天消息的通知
*
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context, BmobMsg msg) {
// 更新通知栏
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.getBelongUsername() + ":" + trueMsg;
// String contentTitle = msg.getBelongUsername() + " (" + mNewNum +
// "条新消息)";
// 解析trueMsg是任务提醒卡,或者勾搭卡
try {
parseCard(context, trueMsg);
} catch (Exception e) {
e.printStackTrace();
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername() + " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, ChatActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
User fuser = new User();
fuser.setObjectId(msg.getBelongId());
fuser.setUsername(msg.getBelongUsername());
fuser.setNick(msg.getBelongNick());
intent.putExtra("user", fuser);
boolean isAllowVoice = SP.isAllowVoice(context);
boolean isAllowVibrate = SP.isAllowVibrate(context);
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice, isAllowVibrate, R.drawable.ic_launcher,
tickerText.toString(), contentTitle, tickerText.toString(), intent);
}
}
示例15: getItemViewType
@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;
}
}