• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BmobChatUser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cn.bmob.im.bean.BmobChatUser的典型用法代码示例。如果您正苦于以下问题:Java BmobChatUser类的具体用法?Java BmobChatUser怎么用?Java BmobChatUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BmobChatUser类属于cn.bmob.im.bean包,在下文中一共展示了BmobChatUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addFriendAfterAgree

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
private void addFriendAfterAgree(JSONObject jo, final String json) {
    final String username = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TARGETUSERNAME);
    final String nick= BmobJsonUtil.getString(jo,BmobConstant.PUSH_KEY_TARGETNICK);
    final String toId=BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TOID);
    //收到对方的同意请求之后,就得添加对方为好友--已默认添加同意方为好友,并保存到本地好友数据库
    BmobUserManager.getInstance(context).addContactAfterAgree(username, new FindListener<BmobChatUser>() {
        @Override
        public void onSuccess(List<BmobChatUser> list) {
            if(application.isMessageAllowed){
                showOtherNotify(nick, toId, nick + "同意添加你为好友", true);
            }
            //创建一个临时验证会话--用于在会话界面形成初始会话
            BmobMsg.createAndSaveRecentAfterAgree(context, json);
            BBApplication.getInstance().addContactList(list);
        }

        @Override
        public void onError(int i, String s) {

        }
    });

}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:24,代码来源:MyMessageReceiver.java


示例2: onCreate

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    x.Ext.init(this);
    x.Ext.setDebug(true);
    initBmob();
    mInstance=this;
    isCommentAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_COMMENT_ALLOWED,true);
    isVoiceAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_VOICE_ALLOWED, true);
    isVibrateAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_VIBRATE_ALLOWED,true);
    isMessageAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_MESSAGE_ALLOWED,true);
    BmobUserManager.getInstance(this).queryCurrentContactList(new FindListener<BmobChatUser>() {
        @Override
        public void onSuccess(List<BmobChatUser> list) {
            setContactList(list);
        }

        @Override
        public void onError(int i, String s) {
            setContactList(new ArrayList<BmobChatUser>());
        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:24,代码来源:BBApplication.java


示例3: onCreate

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user);
    mUser = (BBUser) getIntent().getSerializableExtra("user");
    mUserName = getIntent().getStringExtra("username");
    initView();
    if(TextUtils.isEmpty(mUserName)) mUserName=mUser.getUsername();
    if(mUserName.equals(BBUser.getCurrentUser(this,BBUser.class).getUsername())){
        mAddFriend.setVisibility(View.GONE);
        mSend.setVisibility(View.GONE);
    }else{
        for(BmobChatUser user: BBApplication.getInstance().getContactList()){
            if(!TextUtils.isEmpty(mUserName)&&mUserName.equals(user.getUsername())){
                mAddFriend.setVisibility(View.GONE);
            }
        }
    }
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:20,代码来源:UserActivity.java


示例4: bindView

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public View bindView(int position, View convertView, ViewGroup parent) {
	if(convertView == null)
		convertView = mLayoutInflater.inflate(R.layout.item_blacklist, null);
	
	BmobChatUser contact = getList().get(position);
	ImageView iv_firend_avatar = (ImageView) convertView.findViewById(R.id.img_friend_avatar);
	TextView tv_friend_name = (TextView) convertView.findViewById(R.id.tv_friend_name);
	String avatar = contact.getAvatar();
	if(avatar != null && !"".equals(avatar)) {
		ImageLoader.getInstance().displayImage(avatar, iv_firend_avatar, ImageLoadOptions.getOptions());
	} else {
		iv_firend_avatar.setImageResource(R.drawable.default_head);
	}
	tv_friend_name.setText(contact.getUsername());
	return convertView;
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:18,代码来源:BlackListAdapter.java


示例5: queryMyfriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/**
 * ��ȡ�����б�
 */
protected void queryMyfriends() {
	// �Ƿ����µĺ�������
	if (BmobDB.create(getActivity()).hasNewInvite()) {
		iv_msg_tips.setVisibility(View.VISIBLE);
	} else {
		iv_msg_tips.setVisibility(View.GONE);
	}
	// ����������һ�α��صĺ������ݿ�ļ�飬��Ϊ�˱��غ������ݿ����Ѿ�����˶Է������ǽ���ȴû����ʾ����������
	// �����������ڴ��б���ĺ����б�
	CustomApplication.getInstance().setContactList(
			CollectionUtils.list2map(BmobDB.create(getActivity())
					.getContactList()));

	Map<String, BmobChatUser> users = CustomApplication.getInstance()
			.getContactList();
	// ��װ�µ�User
	filledData(CollectionUtils.map2list(users));
	if (userAdapter == null) {
		userAdapter = new UserFriendAdapter(getActivity(), friends);
		list_friends.setAdapter(userAdapter);
	} else {
		userAdapter.notifyDataSetChanged();
	}
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:28,代码来源:ContactFragment.java


示例6: onItemClick

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
		long id) {
	BmobRecent recent = adapter.getItem(position);
	//����δ����Ϣ  TODO  ���Ǻ����
	BmobDB.create(getActivity()).resetUnread(recent.getTargetid());
	//��װ�������
	BmobChatUser user = new BmobChatUser();
	user.setAvatar(recent.getAvatar());
	user.setNick(recent.getNick());
	user.setUsername(recent.getUserName());
	user.setObjectId(recent.getTargetid());
	Intent intent = new Intent(getActivity(), ChatActivity.class);
	intent.putExtra("user", user);
	startAnimActivity(intent);
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:17,代码来源:RecentFragment.java


示例7: bindView

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@SuppressLint("InflateParams")
@Override
public View bindView(int arg0, View convertView, ViewGroup arg2) {
	// TODO Auto-generated method stub
	if (convertView == null) {
		convertView = mInflater.inflate(R.layout.item_blacklist, null);
	}
	final BmobChatUser contract = getList().get(arg0);
	TextView tv_friend_name = ViewHolder.get(convertView,
			R.id.tv_friend_name);
	ImageView iv_avatar = ViewHolder.get(convertView,
			R.id.img_friend_avatar);
	String avatar = contract.getAvatar();
	if (avatar != null && !avatar.equals("")) {
		ImageLoader.getInstance().displayImage(avatar, iv_avatar,
				ImageLoadOptions.getOptions());
	} else {
		iv_avatar.setImageResource(R.drawable.default_head);
	}
	tv_friend_name.setText(contract.getNick());
	return convertView;
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:23,代码来源:BlackListAdapter.java


示例8: queryMyfriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/**
 * 获取好友列表 queryMyfriends
 * 
 * @return void
 * @throws
 */
private void queryMyfriends() {
	// 在这里再做一次本地的好友数据库的检查,是为了本地好友数据库中已经添加了对方,但是界面却没有显示出来的问题
	// 重新设置下内存中保存的好友列表
	CustomApplcation.getInstance().setContactList(
			CollectionUtils.list2map(BmobDB.create(getActivity())
					.getContactList()));

	Map<String, BmobChatUser> users = CustomApplcation.getInstance()
			.getContactList();
	// 组装新的User
	filledData(CollectionUtils.map2list(users));
	if (userAdapter == null) {
		userAdapter = new UserFriendAdapter(getActivity(), friends);
		list_friends.setAdapter(userAdapter);
	} else {
		userAdapter.notifyDataSetChanged();
	}

}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:26,代码来源:ContactFragment.java


示例9: onItemClick

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
		long arg3) {
	// TODO Auto-generated method stub
	BmobRecent recent = adapter.getItem(position);
	// 重置未读消息
	BmobDB.create(getActivity()).resetUnread(recent.getTargetid());
	// 组装聊天对象
	BmobChatUser user = new BmobChatUser();
	user.setAvatar(recent.getAvatar());
	user.setNick(recent.getNick());
	user.setUsername(recent.getUserName());
	user.setObjectId(recent.getTargetid());
	Intent intent = new Intent(getActivity(), ChatActivity.class);
	intent.putExtra("user", user);
	startAnimActivity(intent);
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:18,代码来源:RecentFragment.java


示例10: onCreate

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_chat);
	manager = BmobChatManager.getInstance(this);
	MsgPagerNum = 0;
	// 组装聊天对象
	targetUser = (BmobChatUser) getIntent().getSerializableExtra("user");
	targetId = targetUser.getObjectId();
	// BmobLog.i("聊天对象:" + targetUser.getUsername() + ",targetId = "
	// + targetId);
	// 注册广播接收器
	initNewMessageBroadCast();
	initView();
	initRealTimeDataListener();
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:18,代码来源:ChatActivity.java


示例11: bindView

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public View bindView(int arg0, View convertView, ViewGroup arg2) {
	// TODO Auto-generated method stub
	if (convertView == null) {
		convertView = mInflater.inflate(R.layout.item_blacklist, null);
	}
	final BmobChatUser contract = getList().get(arg0);
	TextView tv_friend_name = ViewHolder.get(convertView, R.id.tv_friend_name);
	ImageView iv_avatar = ViewHolder.get(convertView, R.id.img_friend_avatar);
	String avatar = contract.getAvatar();
	if (avatar != null && !avatar.equals("")) {
		ImageLoader.getInstance().displayImage(avatar, iv_avatar, ImageLoadOptions.getOptions());
	} else {
		iv_avatar.setImageResource(R.drawable.default_head);
	}
	tv_friend_name.setText(contract.getUsername());
	return convertView;
}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:19,代码来源:BlackListAdapter.java


示例12: queryMyfriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/** ��ȡ�����б�
  * queryMyfriends
  * @return void
  * @throws
  */
private void queryMyfriends() {
	//�Ƿ����µĺ�������
	if(BmobDB.create(getActivity()).hasNewInvite()){
		iv_msg_tips.setVisibility(View.VISIBLE);
	}else{
		iv_msg_tips.setVisibility(View.GONE);
	}
	
	CustomApplcation.getInstance().setContactList(CollectionUtils.list2map(BmobDB.create(getActivity()).getContactList()));

	Map<String,BmobChatUser> users = CustomApplcation.getInstance().getContactList();
	//��װ�µ�User
	filledData(CollectionUtils.map2list(users));
	if(userAdapter==null){
		userAdapter = new UserFriendAdapter(getActivity(), friends);
		list_friends.setAdapter(userAdapter);
	}else{
		userAdapter.notifyDataSetChanged();
	}

}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:27,代码来源:ContactFragment.java


示例13: onItemClick

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
	// TODO Auto-generated method stub
	BmobRecent recent = adapter.getItem(position);
	//����δ����Ϣ
	BmobDB.create(getActivity()).resetUnread(recent.getTargetid());
	//��װ�������
	BmobChatUser user = new BmobChatUser();
	user.setAvatar(recent.getAvatar());
	user.setNick(recent.getNick());
	user.setUsername(recent.getUserName());
	user.setObjectId(recent.getTargetid());
	Intent intent = new Intent(getActivity(), ChatActivity.class);
	intent.putExtra("user", user);
	startAnimActivity(intent);
}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:17,代码来源:RecentFragment.java


示例14: queryMyfriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/** ��ȡ�����б�
  * queryMyfriends
  * @return void
  * @throws
  */
private void queryMyfriends() {
	//�Ƿ����µĺ�������
	if(BmobDB.create(getActivity()).hasNewInvite()){
		iv_msg_tips.setVisibility(View.VISIBLE);
	}else{
		iv_msg_tips.setVisibility(View.GONE);
	}
	//����������һ�α��صĺ������ݿ�ļ�飬��Ϊ�˱��غ������ݿ����Ѿ�����˶Է������ǽ���ȴû����ʾ����������
	// �����������ڴ��б���ĺ����б�
	CustomApplication.getInstance().setContactList(CollectionUtils.list2map(BmobDB.create(getActivity()).getContactList()));

	Map<String,BmobChatUser> users = CustomApplication.getInstance().getContactList();
	//��װ�µ�User
	filledData(CollectionUtils.map2list(users));
	if(userAdapter==null){
		userAdapter = new UserFriendAdapter(getActivity(), friends);
		list_friends.setAdapter(userAdapter);
	}else{
		userAdapter.notifyDataSetChanged();
	}

}
 
开发者ID:liuyanggithub,项目名称:Hi,代码行数:28,代码来源:ContactFragment.java


示例15: onCreate

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_chat);
		manager = BmobChatManager.getInstance(this);
		MsgPagerNum = 0;
		// ��װ�������
		targetUser = (BmobChatUser) getIntent().getSerializableExtra("user");
		targetId = targetUser.getObjectId();
//		BmobLog.i("�������" + targetUser.getUsername() + ",targetId = "
//				+ targetId);
		//ע��㲥������
		initNewMessageBroadCast();
		initView();
	}
 
开发者ID:liuyanggithub,项目名称:Hi,代码行数:17,代码来源:ChatActivity.java


示例16: bindView

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public View bindView(int arg0, View convertView, ViewGroup arg2) {
	if (convertView == null) {
		convertView = mInflater.inflate(R.layout.item_blacklist, null);
	}
	final BmobChatUser contract = getList().get(arg0);
	TextView tv_friend_name = ViewHolder.get(convertView, R.id.tv_friend_name);
	ImageView iv_avatar = ViewHolder.get(convertView, R.id.img_friend_avatar);
	String avatar = contract.getAvatar();
	if (avatar != null && !avatar.equals("")) {
		ImageLoader.getInstance().displayImage(avatar, iv_avatar, ImageLoadOptions.getOptions());
	} else {
		iv_avatar.setImageResource(R.drawable.default_photo);
	}
	tv_friend_name.setText(contract.getUsername());
	return convertView;
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:18,代码来源:BlackListAdapter.java


示例17: showRemoveBlackDialog

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/**
 * 显示移除黑名单对话框
 * @Title: showRemoveBlackDialog
 * @Description: TODO
 * @param @param position
 * @param @param invite
 * @return void
 * @throws
 */
public void showRemoveBlackDialog(final int position, final BmobChatUser user) {
	new Builder(context).setTitle("移除黑名单").setMessage("确实移出黑名单吗?").setPositiveButton("确定", new DialogInterface.OnClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int which) {
			adapter.remove(position);
			userManager.removeBlack(user.getUsername(), new UpdateListener() {
				@Override
				public void onSuccess() {
					T.show(context, "移出黑名单成功");
					// 重新设置下内存中保存的好友列表
					CustomApplication.getInstance().setContactList(
							CollectionUtils.list2map(BmobDB.create(getApplicationContext()).getContactList()));
				}

				@Override
				public void onFailure(int arg0, String arg1) {
					T.show(context, "移出黑名单失败:" + arg1);
				}
			});

		}
	}).setNegativeButton("取消", null).show();
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:33,代码来源:BlackListActivity.java


示例18: queryMyfriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
/**
 * 获取好友列表 queryMyfriends
 * @return void
 * @throws
 */
private void queryMyfriends() {
	// 是否有新的好友请求
	if (BmobDB.create(context).hasNewInvite()) {
		iv_msg_tips.setVisibility(View.VISIBLE);
	} else {
		iv_msg_tips.setVisibility(View.GONE);
	}
	// 在这里再做一次本地的好友数据库的检查,是为了本地好友数据库中已经添加了对方,但是界面却没有显示出来的问题
	// 重新设置下内存中保存的好友列表
	CustomApplication.getInstance().setContactList(CollectionUtils.list2map(BmobDB.create(context).getContactList()));

	Map<String, BmobChatUser> users = CustomApplication.getInstance().getContactList();
	// 组装新的User
	filledData(CollectionUtils.map2list(users));
	if (userAdapter == null) {
		userAdapter = new UserFriendAdapter(context, friends);
		list_friends.setAdapter(userAdapter);
	} else {
		userAdapter.notifyDataSetChanged();
	}

}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:28,代码来源:FriendActivity.java


示例19: queryMymFriends

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
private void queryMymFriends() {
    //是否有新的好友请求
    if (BmobDB.create(getActivity()).hasNewInvite()) {
        mMsgTipImg.setVisibility(View.VISIBLE);
    } else {
        mMsgTipImg.setVisibility(View.GONE);
    }
    Map<String, BmobChatUser> users = CustomApplication.getInstance().getContactList();
    //组装新的User
    filledData(CollectionUtils.map2list(users));
    if (mUserAdapter == null) {
        mUserAdapter = new ContactAdapter(getActivity(), mFriends);
        mFriendListView.setAdapter(mUserAdapter);
    } else {
        mUserAdapter.notifyDataSetChanged();
    }

}
 
开发者ID:klob,项目名称:Diandi1.20,代码行数:19,代码来源:ContactFragment.java


示例20: onItemClick

import cn.bmob.im.bean.BmobChatUser; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
    // TODO Auto-generated method stub
    BmobRecent recent = mMessageRecentAdapter.getItem(position);
    //重置未读消息
    BmobDB.create(getActivity()).resetUnread(recent.getTargetid());
    //组装聊天对象
    BmobChatUser user = new BmobChatUser();
    user.setAvatar(recent.getAvatar());
    user.setNick(recent.getNick());
    user.setUsername(recent.getUserName());
    user.setObjectId(recent.getTargetid());
    Intent intent = new Intent(getActivity(), ChatActivity.class);
    intent.putExtra("user", user);
    startAnimActivity(intent);
}
 
开发者ID:klob,项目名称:Diandi1.20,代码行数:17,代码来源:RecentFragment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NavigationTabStrip类代码示例发布时间:2022-05-23
下一篇:
Java Signature类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap