当前位置: 首页>>代码示例>>Java>>正文


Java BmobConfig.TYPE_IMAGE属性代码示例

本文整理汇总了Java中cn.bmob.im.config.BmobConfig.TYPE_IMAGE属性的典型用法代码示例。如果您正苦于以下问题:Java BmobConfig.TYPE_IMAGE属性的具体用法?Java BmobConfig.TYPE_IMAGE怎么用?Java BmobConfig.TYPE_IMAGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在cn.bmob.im.config.BmobConfig的用法示例。


在下文中一共展示了BmobConfig.TYPE_IMAGE属性的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);
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:26,代码来源:MyMessageReceiver.java

示例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);
	}
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:24,代码来源:MessageChatAdapter.java

示例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;
	}
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:17,代码来源:MessageChatAdapter.java

示例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);
	}
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:21,代码来源:MessageChatAdapter.java

示例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);
	}
}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:24,代码来源:MessageChatAdapter.java

示例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);
	}
}
 
开发者ID:liuyanggithub,项目名称:Hi,代码行数:24,代码来源:MessageChatAdapter.java

示例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);
	}
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:16,代码来源:MessageChatAdapter.java

示例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);
    }
}
 
开发者ID:klob,项目名称:Diandi1.20,代码行数:21,代码来源:ChatAdapter.java

示例9: getView

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View v=convertView;
    ViewHolder holder=null;
    BmobRecent recent=mRecents.get(position);
    if(v==null){
        v=View.inflate(MessageActivity.this,R.layout.item_chat_message,null);
        holder=new ViewHolder();
        holder.nickChat= (TextView) v.findViewById(R.id.tv_nick_chat);
        holder.msg= (TextView) v.findViewById(R.id.tv_msg_chat);
        holder.date= (TextView) v.findViewById(R.id.tv_date_chat);
        holder.unread= (TextView) v.findViewById(R.id.tv_unread_chat);
        holder.avatarChat= (CircularImageView) v.findViewById(R.id.iv_avatar_chat);
        v.setTag(holder);
    }else{
        holder= (ViewHolder) v.getTag();
    }

    x.image().bind(holder.avatarChat, recent.getAvatar());
    holder.nickChat.setText(recent.getNick());
    holder.date.setText(TimeUtil.getChatTime(recent.getTime()));
    if(recent.getType()==BmobConfig.TYPE_TEXT){
        SpannableString spannableString = FaceTextUtils.toSpannableString(MessageActivity.this, recent.getMessage());
        holder.msg.setText(spannableString);
    }else if(recent.getType()==BmobConfig.TYPE_IMAGE){
        holder.msg.setText("[图片]");
    } else if(recent.getType()==BmobConfig.TYPE_VOICE){
        holder.msg.setText("[语音]");
    }
    int num = BmobDB.create(MessageActivity.this).getUnreadCount(recent.getTargetid());
    if(num>0){
        holder.unread.setVisibility(View.VISIBLE);
        if(num>100){
            holder.unread.setText("99¨");
        }
        holder.unread.setText(num+"");
    }
    return v;
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:39,代码来源:MessageActivity.java

示例10: getItemViewType

@Override
public int getItemViewType(int position) {
    BmobMsg msg = mMsgs.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_VOICE){
        return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_VOICE: TYPE_RECEIVER_VOICE;
    }else{
        return msg.getBelongId().equals(currentObjectId) ? TYPE_SEND_TXT: TYPE_RECEIVER_TXT;
    }
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:11,代码来源:ChatActivity.java

示例11: getViewByType

private View getViewByType(int msgType, int position) {
    View v=null;
    if(msgType==BmobConfig.TYPE_IMAGE){//图片类型
        return getItemViewType(position) == TYPE_RECEIVER_IMAGE ?
                null
                :
                null;
    }else if(msgType==BmobConfig.TYPE_VOICE){//语音类型
        if(getItemViewType(position) == TYPE_RECEIVER_VOICE){
            v=View.inflate(ChatActivity.this,R.layout.item_received_voice, null);
            v.setTag(R.id.type_of_convert,TYPE_RECEIVER_VOICE);
        }else{
            v=View.inflate(ChatActivity.this,R.layout.item_sent_voice, null);
            v.setTag(R.id.type_of_convert,TYPE_SEND_VOICE);
        }
        return v;
    }else{//剩下默认的都是文本
        if(getItemViewType(position) == TYPE_RECEIVER_TXT){
            v=View.inflate(ChatActivity.this,R.layout.item_received_message, null);
            v.setTag(R.id.type_of_convert,TYPE_RECEIVER_TXT);
        }else{
            v=View.inflate(ChatActivity.this,R.layout.item_sent_message, null);
            v.setTag(R.id.type_of_convert,TYPE_SEND_TXT);
        }
        return v;
    }
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:27,代码来源:ChatActivity.java

示例12: 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);
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:33,代码来源:MyMessageReceiver.java

示例13: 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;
	}
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:13,代码来源:MessageChatAdapter.java

示例14: 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);
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:39,代码来源:MyMessageReceiver.java

示例15: 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);
}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:32,代码来源:MyMessageReceiver.java


注:本文中的cn.bmob.im.config.BmobConfig.TYPE_IMAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。