cn.bmob.v3.BmobObject Java Examples

The following examples show how to use cn.bmob.v3.BmobObject. 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: MsgManager.java    From NewFastFrame with Apache License 2.0 6 votes vote down vote up
private void uploadChatTableMessage(final GroupTableMessage groupTableMessage, QueryListListener<BatchResult> listener) {
    List<String> groupNumber = groupTableMessage.getGroupNumber();
    GroupTableMessage message;
    List<String> copy = new ArrayList<>(groupNumber);
    if (copy.contains(UserManager.getInstance().getCurrentUserObjectId())) {
        copy.remove(UserManager.getInstance().getCurrentUserObjectId());
    }
    List<BmobObject> groupTableMessageList = new ArrayList<>();
    for (int i = 0; i < copy.size(); i++) {
        message = new GroupTableMessage();
        message.setSendStatus(ConstantUtil.SEND_STATUS_SUCCESS);
        message.setReadStatus(ConstantUtil.READ_STATUS_UNREAD);
        message.setGroupDescription(groupTableMessage.getGroupDescription());
        message.setGroupId(groupTableMessage.getGroupId());
        message.setCreatedTime(groupTableMessage.getCreatedTime());
        message.setToId(copy.get(i));
        message.setGroupNumber(groupNumber);
        message.setGroupAvatar(groupTableMessage.getGroupAvatar());
        message.setGroupName(groupTableMessage.getGroupName());
        message.setNotification(groupTableMessage.getNotification());
        message.setCreatorId(groupTableMessage.getCreatorId());
        message.setRemind(message.getRemind());
        groupTableMessageList.add(message);
    }
    new BmobBatch().insertBatch(groupTableMessageList).doBatch(listener);
}
 
Example #2
Source File: MsgManager.java    From NewFastFrame with Apache License 2.0 6 votes vote down vote up
public void updateCommentReadStatus(List<CommentNotifyBean> result) {
    for (CommentNotifyBean bean :
            result) {
        bean.setReadStatus(ConstantUtil.READ_STATUS_READED);
    }
    List<BmobObject> bmobObjectList = new ArrayList<>(result);
    new BmobBatch().updateBatch(bmobObjectList).doBatch(new QueryListListener<BatchResult>() {
        @Override
        public void done(List<BatchResult> list, BmobException e) {
            if (e == null) {
                CommonLogger.e("批量更新评论已读成功");
            } else {
                CommonLogger.e("批量更新评论已读失败" + e.toString());
            }
        }
    });
}
 
Example #3
Source File: MsgManager.java    From TestChat with Apache License 2.0 6 votes vote down vote up
private void uploadChatTableMessage(final GroupTableMessage groupTableMessage, SaveListener listener) {
        List<String> groupNumber = groupTableMessage.getGroupNumber();
        GroupTableMessage message;
        List<String> copy = new ArrayList<>(groupNumber);
        if (copy.contains(UserManager.getInstance().getCurrentUserObjectId())) {
                copy.remove(UserManager.getInstance().getCurrentUserObjectId());
        }
        List<BmobObject> groupTableMessageList = new ArrayList<>();
        for (int i = 0; i < copy.size(); i++) {
                message = new GroupTableMessage();
                message.setSendStatus(Constant.SEND_STATUS_SUCCESS);
                message.setReadStatus(Constant.READ_STATUS_UNREAD);
                message.setGroupDescription(groupTableMessage.getGroupDescription());
                message.setGroupId(groupTableMessage.getGroupId());
                message.setCreatedTime(groupTableMessage.getCreatedTime());
                message.setToId(copy.get(i));
                message.setGroupNumber(groupNumber);
                message.setGroupAvatar(groupTableMessage.getGroupAvatar());
                message.setGroupName(groupTableMessage.getGroupName());
                message.setGroupNick(groupTableMessage.getGroupNick());
                message.setNotification(groupTableMessage.getNotification());
                message.setCreatorId(groupTableMessage.getCreatorId());
                groupTableMessageList.add(message);
        }
        new BmobObject().insertBatch(CustomApplication.getInstance(), groupTableMessageList, listener);
}
 
Example #4
Source File: BaseDataAdapter.java    From WliveTV with Apache License 2.0 6 votes vote down vote up
public BaseDataAdapter(Context context, List<? extends BmobObject> mDatas) {
    this.context = context;
    this.mDatas = mDatas;
    options = new DisplayImageOptions.Builder()
                    .showImageOnLoading(R.mipmap.icon_live_item_default)
            .showImageForEmptyUri(R.mipmap.icon_live_item_default)
            .showImageOnFail(R.mipmap.icon_live_item_default)
            .cacheInMemory(false)
            .cacheOnDisk(true)
            .considerExifParams(true)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .displayer(new SimpleBitmapDisplayer())
            .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
            .build();
    if (this.context == null) {
        System.out.println("this.context is null");
    } else {
        mlayoutInflate = LayoutInflater.from(this.context);
    }
}
 
Example #5
Source File: BmobCourseDataSource.java    From ZfsoftCampusAssit with Apache License 2.0 6 votes vote down vote up
@Override
public void saveTimetableCourses(List<Course> courses) {
    if (!courses.isEmpty() && mContext != null) {
        new BmobObject().insertBatch(mContext, new ArrayList<BmobObject>(courses), new SaveListener() {
            @Override
            public void onSuccess() {
                Log.d(tag,"bmob batch timetable courses saved successful.");
            }

            @Override
            public void onFailure(int i, String s) {
                Log.e(tag,"bmob batch timetable courses failure.");
            }
        });
    } else {
        Log.e(tag,"bmob batch insert cannot null");
    }
}