cn.bmob.v3.listener.FindListener Java Examples
The following examples show how to use
cn.bmob.v3.listener.FindListener.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NewFriendAdapter.java From NewFastFrame with Apache License 2.0 | 6 votes |
@Override protected void convert(BaseWrappedViewHolder holder, ChatMessageEntity data, boolean isSwipeItem) { UserManager.getInstance().findUserById(data.getBelongId(), new FindListener<User>() { @Override public void done(List<User> list, BmobException e) { if (list != null && list.size() > 0) { holder.setImageUrl(R.id.iv_new_friend_item_avatar, list.get(0).getAvatar()) .setText(R.id.tv_new_friend_item_name, list.get(0).getName()); } } }); if (data.getReadStatus()==ConstantUtil.READ_STATUS_READED) { holder.setVisible(R.id.tv_new_friend_item_agree, true); holder.setVisible(R.id.btn_new_friend_item_agree, false); } else if (data.getReadStatus()==ConstantUtil.READ_STATUS_READED) { holder.setVisible(R.id.btn_new_friend_item_agree, false); holder.setVisible(R.id.tv_new_friend_item_agree, true); } holder.setOnItemChildClickListener(R.id.btn_new_friend_item_agree); }
Example #2
Source File: AttentionModel.java From Aurora with Apache License 2.0 | 6 votes |
@Override public Observable<List<MyAttentionEntity>> getMyAttentionList(String userid) { return Observable.create((ObservableOnSubscribe<List<MyAttentionEntity>>) emitter -> { BmobQuery<MyAttentionEntity> query = new BmobQuery<MyAttentionEntity>(); query.addWhereEqualTo("userId", userid); query.order("-createdAt"); query.findObjects(new FindListener<MyAttentionEntity>() { @Override public void done(List<MyAttentionEntity> list, BmobException e) { if (list!=null) emitter.onNext(list); } }); }); }
Example #3
Source File: RandomData.java From NewFastFrame with Apache License 2.0 | 6 votes |
public static void initTitleWallPaper() { MsgManager.getInstance().getAllDefaultTitleWallPaperFromServer(new FindListener<String>() { @Override public void done(List<String> list, BmobException e) { if (e == null) { if (list != null && list.size() > 0) { LogUtil.e("获取到默认背景数据拉"); for (String url : list) { LogUtil.e(url); } titleWallPaper.addAll(list); } else { LogUtil.e("从服务器上获取的到的默认的背景数据为空"); } } else { LogUtil.e("从服务器上获取的到的默认的背景数据失败" + e.toString()); } } }); }
Example #4
Source File: ShowSignerActivity.java From VSigner with GNU General Public License v2.0 | 6 votes |
public void refreshData() { BmobQuery<ChannelSigner> channelQuery = new BmobQuery<ChannelSigner>(); channelQuery.addWhereEqualTo(ChannelSigner.CHANNEL_KEY, mChannel.getObjectId()); channelQuery.addWhereGreaterThanOrEqualTo(ChannelSigner.SIGN_DATE_KEY, mChannel.getStartSignDate()); channelQuery.include(String.format("%1$s,%2$s", ChannelSigner.SIGNER_KEY, ChannelSigner.CHANNEL_KEY)); channelQuery.setLimit(Constants.QUERY_MAX_NUMBER); channelQuery.order(ChannelSigner.SIGNER_KEY); channelQuery.findObjects(mContext, new FindListener<ChannelSigner>() { @Override public void onSuccess(List<ChannelSigner> channelSigners) { mChannelSignerAdapter.clear(); mChannelSignerAdapter.addAll(channelSigners); mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED); } @Override public void onError(int arg0, String msg) { mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL); } }); }
Example #5
Source File: RandomData.java From NewFastFrame with Apache License 2.0 | 6 votes |
public static void initRandomAvatar() { if (avatarList.size() > 0) { avatarList.clear(); } MsgManager.getInstance().getAllDefaultAvatarFromServer(new FindListener<String>() { @Override public void done(List<String> list, BmobException e) { if (e == null) { if (list != null && list.size() > 0) { LogUtil.e("获取到默认头像数据拉"); for (String url : list) { LogUtil.e(url); } avatarList.addAll(list); } else { LogUtil.e("从服务器上获取的到的默认的头像数据为空"); } } else { LogUtil.e("从服务器上获取的到的默认的头像数据失败" + e.toString()); } } }); }
Example #6
Source File: CommentListActivity_.java From styT with Apache License 2.0 | 6 votes |
private void findComments() { BmobQuery<Comment_> query = new BmobQuery<Comment_>(); // pointer类型 query.addWhereEqualTo("post", new BmobPointer(weibo)); query.include("user,post.author"); query.findObjects(new FindListener<Comment_>() { @Override public void done(List<Comment_> object, BmobException e) { if (e == null) { comments = object; adapter.notifyDataSetChanged(); et_content.setText(""); } else { //loge(e); } } }); }
Example #7
Source File: MyTripsActivity.java From Mobike with Apache License 2.0 | 6 votes |
private void requestData() { mDialog.show(); if (mQuery == null) { mQuery = new BmobQuery<>("MyTripsData"); mQuery.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId()); mQuery.order("-updatedAt"); } mQuery.findObjects(new FindListener<MyTripsData>() { @Override public void done(List<MyTripsData> list, BmobException e) { if (e == null) { mData = list; showMyTrips(); } else { ToastUtils.show(MyTripsActivity.this, "暂时没有骑行记录"); Logger.d(e); } dismissMyDialog(); } }); }
Example #8
Source File: Compat3.java From styT with Apache License 2.0 | 6 votes |
/** * 查询微博 */ private void findWeibos() { BmobQuery<Post_> query = new BmobQuery<Post_>(); query.order("-updatedAt"); query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法 query.findObjects(new FindListener<Post_>() { @Override public void done(List<Post_> object, BmobException e) { if (e == null) { weibos = object; adapter.notifyDataSetChanged(); } else { //loge(e); } } }); }
Example #9
Source File: SampleAdapter.java From styT with Apache License 2.0 | 6 votes |
@Override protected void onBindItemViewHolder(ItemViewHolder holder, final int headerPosition, final int itemPosition) { final Comment weibo = weibos.get(itemPosition); MyUser user = BmobUser.getCurrentUser(MyUser.class); BmobQuery<Comment> query = new BmobQuery<>(); //query.addWhereEqualTo("author", user); // 查询当前用户的所有微博 query.order("-updatedAt"); query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法 query.setLimit(4); query.findObjects(new FindListener<Comment>() { @Override public void done(List<Comment> object, BmobException e) { if (e == null) { weibos = object; adapter.notifyDataSetChanged(); } else { } } }); //adapter = new MyAdapter(getActivity()); holder.listView.setAdapter(adapter); }
Example #10
Source File: LastTenTripHistoryActivity.java From Mobike with Apache License 2.0 | 6 votes |
private void requestData() { mDialog.show(); if (mQuery == null) { mQuery = new BmobQuery<>("MyTripsData"); mQuery.setLimit(10); mQuery.addWhereEqualTo("mMyUser", MyApplication. getInstance().getUser().getObjectId()); mQuery.order("-updatedAt"); } mQuery.findObjects(new FindListener<MyTripsData>() { @Override public void done(List<MyTripsData> list, BmobException e) { if (e == null) { mData = list; showMyTrips(); } else { ToastUtils.show(LastTenTripHistoryActivity.this, "暂时没有骑行记录"); Logger.d(e); } dismissMyDialog(); } }); }
Example #11
Source File: RechargeHistoryActivity.java From Mobike with Apache License 2.0 | 6 votes |
private void requestData() { BmobQuery<RechargeHistoryData> query = new BmobQuery<>("RechargeHistoryData"); query.order("-updatedAt"); query.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId()); //query.setLimit(4);//最新四条活动信息 if (isFirstin) { mDialog.show(); isFirstin = false; } query.findObjects(new FindListener<RechargeHistoryData>() { @Override public void done(List<RechargeHistoryData> list, BmobException e) { if (e == null) { mDatas = list; showHistory(); } else { ToastUtils.show(RechargeHistoryActivity.this, "暂时没有消息"); Logger.d(e); } dismissMyDialog(); } }); }
Example #12
Source File: TomatoUtils.java From ToDoList with Apache License 2.0 | 6 votes |
/** * 返回网络上用户所有的番茄钟列表 * * @param context * @param currentUser * @throws Exception */ public static void getNetAllTomato(final Context context, User currentUser, final GetTomatoCallBack getTomatoCallBack ) { BmobQuery<Tomato> query = new BmobQuery<Tomato>(); query.addWhereEqualTo("user", currentUser).order("createdAt"); query.findObjects(new FindListener<Tomato>() { @Override public void done(List<Tomato> list, BmobException e) { if (e==null){ Log.i("TomatoUtils", "查询到网络任务个数: " + list.size()); // 1.更新本地数据库 // if (list.size() > 0) { // ClockDao clockDao = new ClockDao(context); // clockDao.saveAll(list); // } getTomatoCallBack.onSuccess(list); } else { Log.i("TomatoUtils", "查询失败:"+e.getMessage()); getTomatoCallBack.onError(e.getErrorCode(),e.getMessage()); } } }); }
Example #13
Source File: LoginActivity.java From Mobike with Apache License 2.0 | 6 votes |
private void RegOK() { mDialog.show(); mPhone = mEtPhone.getText().toString().trim().replace("\\s*", "");// TODO: 2017/6/21 测试后删除 BmobQuery<MyUser> query = new BmobQuery<MyUser>(); query.addWhereEqualTo("username", mPhone); query.setLimit(1); query.findObjects(new FindListener<MyUser>() { @Override public void done(List<MyUser> list, BmobException e) { if (e == null) { if (list.size() > 0 && list != null) { Log.d(TAG, "cheackUser: ok"); toLogin(); } else { Log.d(TAG, "cheackUser: notRegister"); toRegister(); } } else { Log.d(TAG, "done: " + e); DismissMyDialog(); } } }); }
Example #14
Source File: RandomData.java From NewFastFrame with Apache License 2.0 | 6 votes |
public static void initRandomWallPaper() { MsgManager.getInstance().getAllDefaultWallPaperFromServer(new FindListener<String>() { @Override public void done(List<String> list, BmobException e) { if (e == null) { if (list != null && list.size() > 0) { LogUtil.e("获取到默认背景数据拉"); for (String url : list) { LogUtil.e(url); } wallPaperList.addAll(list); } else { LogUtil.e("从服务器上获取的到的默认的背景数据为空"); } } else { LogUtil.e("从服务器上获取的到的默认的背景数据失败" + e.toString()); } } }); }
Example #15
Source File: OwnChannelFragment.java From VSigner with GNU General Public License v2.0 | 6 votes |
public void refreshData() { BmobQuery<Channel> channelQuery = new BmobQuery<Channel>(); channelQuery.addWhereEqualTo(Channel.MANAGER_KEY, mCurrentUser.getObjectId()); channelQuery.include(Channel.MANAGER_KEY); channelQuery.setLimit(Constants.QUERY_MAX_NUMBER); channelQuery.order("-" + Channel.IS_ACTIVE_KEY + ",-" + Constants.UPDATED_AT_KEY); channelQuery.findObjects(mContext, new FindListener<Channel>() { @Override public void onSuccess(List<Channel> channels) { mOwnChannelAdapter.clear(); mOwnChannelAdapter.addAll(channels); mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED); } @Override public void onError(int arg0, String msg) { mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL); } }); }
Example #16
Source File: ChatNotificationManager.java From NewFastFrame with Apache License 2.0 | 6 votes |
private void realSendGroupMessageNotification(String name, GroupChatMessage groupChatMessage, Context context) { UserManager.getInstance().findUserById(groupChatMessage.getBelongId(), new FindListener<User>() { @Override public void done(List<User> list, BmobException e) { if (list != null && list.size() > 0) { if (groupChatMessage.getContentType().equals(ConstantUtil.TAG_MSG_TYPE_IMAGE)) { showNotification(ConstantUtil.NOTIFICATION_TAG_MESSAGE, context, name, R.mipmap.ic_launcher, list.get(0).getName() + ":[图片]", HomeActivity.class); } else if (groupChatMessage.getContentType().equals(ConstantUtil.TAG_MSG_TYPE_LOCATION)) { showNotification(ConstantUtil.NOTIFICATION_TAG_MESSAGE, context, name, R.mipmap.ic_launcher, list.get(0).getName() + ":[位置]", HomeActivity.class); } else if (groupChatMessage.getContentType().equals(ConstantUtil.TAG_MSG_TYPE_VOICE)) { showNotification(ConstantUtil.NOTIFICATION_TAG_MESSAGE, context, name, R.mipmap.ic_launcher, list.get(0).getName() + ":[语音]", HomeActivity.class); } else { showNotification(ConstantUtil.NOTIFICATION_TAG_MESSAGE, context, name, R.mipmap.ic_launcher, list.get(0).getName() + ":" + FaceTextUtil.toSpannableString(context, groupChatMessage.getContent()), HomeActivity.class); } } } }); }
Example #17
Source File: SubscribedChannelFragment.java From VSigner with GNU General Public License v2.0 | 6 votes |
public void refreshData() { BmobQuery<ChannelSubscriber> channelSubscriberQuery = new BmobQuery<ChannelSubscriber>(); channelSubscriberQuery.addWhereEqualTo(ChannelSubscriber.SUBSCRIBER_KEY, mCurrentUser.getObjectId()); channelSubscriberQuery.include(String.format("%1$s,%2$s", ChannelSubscriber.CHANNEL_KEY, ChannelSubscriber.CHANNEL_KEY + "." + Channel.MANAGER_KEY)); channelSubscriberQuery.setLimit(Constants.QUERY_MAX_NUMBER); channelSubscriberQuery.order("-" + Constants.UPDATED_AT_KEY); channelSubscriberQuery.findObjects(mContext, new FindListener<ChannelSubscriber>() { @Override public void onSuccess(List<ChannelSubscriber> channelSubscribers) { mSubscribedChannelAdapter.clear(); for (ChannelSubscriber channelSubscriber : channelSubscribers) { mSubscribedChannelAdapter.add(channelSubscriber.getChannel()); } mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED); } @Override public void onError(int arg0, String msg) { mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL); } }); }
Example #18
Source File: TestActivity.java From Mobike with Apache License 2.0 | 6 votes |
private void cheackUser() { BmobQuery<MyUser> query = new BmobQuery<MyUser>(); query.addWhereEqualTo("username", "182****2002"); query.setLimit(1); query.findObjects(new FindListener<MyUser>() { @Override public void done(List<MyUser> list, BmobException e) { if (e == null) { if (list.size() > 0 && list != null) { Log.d(TAG, "cheackUser: ok"); } else { Log.d(TAG, "cheackUser: not"); } } else { Log.d(TAG, "done: " + e); } } }); }
Example #19
Source File: MainActivity.java From WliveTV with Apache License 2.0 | 6 votes |
public void queryData() { BmobQuery<LiveBean> bmobQuery = new BmobQuery<LiveBean>(); bmobQuery.findObjects(this, new FindListener<LiveBean>() { @Override public void onSuccess(List<LiveBean> list) { System.out.println(list.size()); adapter.updateDatas(list); } @Override public void onError(int i, String s) { } }); }
Example #20
Source File: ShareInfoPresenter.java From NewFastFrame with Apache License 2.0 | 6 votes |
public void getFirstPostNotifyBean() { BmobQuery<PostNotifyBean> bmobQuery = new BmobQuery<>(); bmobQuery.addWhereEqualTo("toUser", new BmobPointer(UserManager.getInstance().getCurrentUser())); bmobQuery.addWhereEqualTo("readStatus", ConstantUtil.READ_STATUS_READED); bmobQuery.order("-createdAt"); bmobQuery.setLimit(1); bmobQuery.include("relatedUser"); addSubscription(bmobQuery.findObjects(new FindListener<PostNotifyBean>() { @Override public void done(List<PostNotifyBean> list, BmobException e) { if (e == null && list != null && list.size() > 0) { RxBusManager.getInstance().post(new UnReadPostNotifyEvent(list.get(0))); } } })); }
Example #21
Source File: CommentDetailPresenter.java From NewFastFrame with Apache License 2.0 | 6 votes |
public void getCommentListDetailData(PublicCommentBean bean ,final boolean isRefresh) { if (isRefresh) { iView.showLoading("正在加载数据........."); } CommentDetailBean commentDetailBean=gson.fromJson(bean.getContent(),CommentDetailBean.class); String[] uidList = commentDetailBean.getPublicId().split("&"); String replyUid; if (uidList[0].equals(bean.getUser().getObjectId())) { replyUid = uidList[1]; } else { replyUid = uidList[0]; } UserManager.getInstance().findUserById(replyUid, new FindListener<User>() { @Override public void done(List<User> list, BmobException e) { if (e == null) { iView.updateData(commentDetailBean.getConversationList() .get(commentDetailBean.getPublicId())); iView.hideLoading(); }else { iView.showError(e.toString(), () -> getCommentListDetailData(bean, isRefresh)); } } }); }
Example #22
Source File: RandomData.java From TestChat with Apache License 2.0 | 6 votes |
public static void initRandomAvatar() { if (avatarList.size() > 0) { avatarList.clear(); } MsgManager.getInstance().getAllDefaultAvatarFromServer(new FindListener<String>() { @Override public void onSuccess(List<String> list) { if (list != null && list.size() > 0) { LogUtil.e("获取到默认头像数据拉"); for (String url : list) { LogUtil.e(url); } avatarList.addAll(list); } else { LogUtil.e("从服务器上获取的到的默认的头像数据为空"); } } @Override public void onError(int i, String s) { LogUtil.e("从服务器上获取的到的默认的头像数据失败" + s + i); } }); }
Example #23
Source File: LoginActivity.java From Swface with Apache License 2.0 | 6 votes |
private void startSearchUser(final String username, final String password) { BmobQuery<UserLogin> query = new BmobQuery<>(); query.addWhereEqualTo("username", username); query.setLimit(1); query.findObjects(new FindListener<UserLogin>() { @Override public void done(List<UserLogin> list, BmobException e) { if (e == null && !list.isEmpty()) { startLogin(list.get(0)); } else if (e == null) { startRegister(username, password); } else { showNormalDia("温馨提示", "登录失败!请检查网络连接"); Log.e(TAG, "query.findObjects: ", e); } } }); }
Example #24
Source File: HomeFragment.java From BitkyShop with MIT License | 6 votes |
/** * 广告栏Slider数据初始化 */ private void getBmobSliderData() { BmobQuery<Commodity> bmobQuery = new BmobQuery<>(); bmobQuery.addWhereEqualTo("AD", "true").setLimit(5).findObjects(new FindListener<Commodity>() { @Override public void done(List<Commodity> list, BmobException e) { if (e != null) { KLog.d(TAG, "异常内容:" + e.getMessage()); } else if (list.size() > 0) { KLog.d(TAG, "list.size():" + list.size()); mTextSliderViews = new ArrayList<>(); for (Commodity commodity : list) { mTextSliderViews.add( buildTextSlider(commodity.getCoverPhotoUrl(), commodity.getName(), 0)); } KLog.d(TAG, "mTextSliderViews.size():" + mTextSliderViews.size()); if (mSliderLayout != null) initSlider(); } } }); }
Example #25
Source File: OrderActivity.java From BitkyShop with MIT License | 6 votes |
private void queryDefaultAddressFromBmob() { BmobQuery<ReceiveAddress> bmobQuery = new BmobQuery<>(); bmobQuery.addWhereEqualTo("userObjectId", order.getUserObjectId()); bmobQuery.addWhereEqualTo("isDefault", true); bmobQuery.setLimit(50); bmobQuery.findObjects(new FindListener<ReceiveAddress>() { @Override public void done(List<ReceiveAddress> list, BmobException e) { if (e != null) { toastUtil.show(e.getMessage()); return; } if (list.size() > 0) { receiveAddress = list.get(0); name.setText(receiveAddress.getName()); phone.setText(receiveAddress.getPhone()); address.setText(receiveAddress.getAddress()); } } }); }
Example #26
Source File: CommentListActivity.java From stynico with MIT License | 6 votes |
private void findComments() { BmobQuery<Comment_> query = new BmobQuery<Comment_>(); // pointer类型 query.addWhereEqualTo("post", new BmobPointer(weibo)); query.include("user,post.author"); query.findObjects(getActivity(), new FindListener<Comment_>() { @Override public void onSuccess(List<Comment_> object) { // TODO Auto-generated method stub comments = object; adapter.notifyDataSetChanged(); et_content.setText(""); } @Override public void onError(int code, String msg) { // TODO Auto-generated method stub //toast("查询失败:"+msg); } });}
Example #27
Source File: WeiboListActivity.java From stynico with MIT License | 6 votes |
private void findWeibos_() { nico.styTool.MyUser user = BmobUser.getCurrentUser(this, nico.styTool.MyUser.class); BmobQuery<Post_> query = new BmobQuery<Post_>(); query.addWhereEqualTo("author", user); // 查询当前用户的所有微博 query.order("-updatedAt"); query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法 query.findObjects(this, new FindListener<Post_>() { @Override public void onSuccess(List<Post_> object) { // TODO Auto-generated method stub weibos = object; adapter.notifyDataSetChanged(); //et_content.setText(""); } @Override public void onError(int code, String msg) { // TODO Auto-generated method stub //toast("查询失败:"+msg); } }); }
Example #28
Source File: ReviewFragment.java From AndroidReview with GNU General Public License v3.0 | 6 votes |
/** * “单元”列表下拉刷新具体实现 */ private void putToRefreshByUnit() { //初始化Bmob查询类 BmobQuery<Unit> query = new BmobQuery<>(); //执行查询,查询单元表 取出所有单元 query.findObjects(getContext(), new FindListener<Unit>() { @Override public void onSuccess(final List<Unit> unitList) { //根据查询的所有单元,请求所有的知识点数据 requestPointByUnits(unitList); } @Override public void onError(int i, String s) { toastError(mLoadingLayout, getContext()); } }); }
Example #29
Source File: BmobCourseDataSource.java From ZfsoftCampusAssit with Apache License 2.0 | 6 votes |
@Override public void getLocalWeekTimetableCourses(int currentWeekNo, final LoadCoursesCallback callback) { BmobQuery<Course> weekCourseQuery = new BmobQuery<>(); weekCourseQuery.addWhereContains( CoursePersistenceContract.CourseTimetableEntry.COLUMN_NAME_WEEKS, String.valueOf(currentWeekNo)); weekCourseQuery.findObjects(mContext, new FindListener<Course>() { @Override public void onSuccess(List<Course> list) { callback.onCoursesLoaded(list); } @Override public void onError(int i, String s) { callback.onDataError(); } }); }
Example #30
Source File: DeveloperInfoActivity.java From NewFastFrame with Apache License 2.0 | 5 votes |
@Override protected void initData() { showLoading("正在加载用户数据...."); UserManager.getInstance().findUserById(ConstantUtil.SYSTEM_UID, new FindListener<User>() { @Override public void done(List<User> list, BmobException e) { if (e == null && list != null && list.size() > 0) { hideLoading(); updateUserInfo(list.get(0)); } else { showError(e != null ? e.getMessage() : null, null); } } }); }