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


Java ParseQuery.addDescendingOrder方法代码示例

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


在下文中一共展示了ParseQuery.addDescendingOrder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCachedNotes

import com.parse.ParseQuery; //导入方法依赖的package包/类
public void getCachedNotes(final NoteAdapter adapter){
    ParseQuery<Note> noteQuery = ParseQuery.getQuery(Note.class);
    noteQuery.fromPin(NOTE);
    noteQuery.addDescendingOrder("createdAt");
    noteQuery.findInBackground(new FindCallback<Note>() {
       @Override
       public void done(List<Note> objects, ParseException e) {
           adapter.updateItems(objects);
       }
   });
    Log.d("RV", "NOTIFIED IN DATASYNC");

}
 
开发者ID:donniepropst,项目名称:note.cntxt,代码行数:14,代码来源:DataSync.java

示例2: loadInternal

import com.parse.ParseQuery; //导入方法依赖的package包/类
private Observable<LoadResult<ExampleMessage>> loadInternal(@NonNull String conversationId, @NonNull LoadQuery.Type type, long timestamp) {
    final ParseQuery<ParseObject> parseQuery = new ParseQuery<>(MessagesTable.NAME);
    parseQuery.whereEqualTo(MessagesTable.Fields.CHAT, ParseObject.createWithoutData(ChatTable.NAME, conversationId));
    parseQuery.addDescendingOrder(MessagesTable.Fields.CREATED_AT);
    if (type == Type.OLDER) {
        parseQuery.whereLessThan(MessagesTable.Fields.CREATED_AT, new Date(timestamp));
    }
    else if (type == Type.NEWER) {
        parseQuery.whereGreaterThan(MessagesTable.Fields.CREATED_AT, new Date(timestamp));
    }
    parseQuery.setLimit(MAX_CHUNK_SIZE);
    parseQuery.include(MessagesTable.Fields.IMAGE);

    return mParseHelper.find(parseQuery)
        .doOnNext(mSortMessagesAscending)
        .flatMap(Observable::from)
        .map(in -> ParseUtils.from(in, mParseHelper))
        .toList()
        .map(messages -> {
            final boolean canLoadOlder;
            final boolean canLoadNewer;
            if (type == Type.OLDER) {
                canLoadOlder = !messages.isEmpty();
                canLoadNewer = true; // This will be ignored in any case since we are loading older messages
            }
            else if (type == Type.NEWER) {
                canLoadOlder = true; // This will be ignored in any case since we are loading newer messages
                canLoadNewer = !messages.isEmpty();
            }
            else {
                canLoadOlder = !messages.isEmpty();
                canLoadNewer = !messages.isEmpty();
            }
            return new LoadResult<>(messages, canLoadOlder, canLoadNewer);
        })
        .subscribeOn(Schedulers.io());
}
 
开发者ID:badoo,项目名称:Chateau,代码行数:38,代码来源:ParseMessageDataSource.java

示例3: retrieveMessages

import com.parse.ParseQuery; //导入方法依赖的package包/类
private void retrieveMessages() {
	ParseQuery<ParseObject> query = new ParseQuery<ParseObject>(ParseConstants.CLASS_MESSAGES);
	query.whereEqualTo(ParseConstants.KEY_RECIPIENT_IDS, ParseUser.getCurrentUser().getObjectId());
	query.addDescendingOrder(ParseConstants.KEY_CREATED_AT);
	query.findInBackground(new FindCallback<ParseObject>() {
		@Override
		public void done(List<ParseObject> messages, ParseException e) {
			getActivity().setProgressBarIndeterminateVisibility(false);
			
			if (mSwipeRefreshLayout.isRefreshing()) {
				mSwipeRefreshLayout.setRefreshing(false);
			}
			
			if (e == null) {
				// We found messages!
				mMessages = messages;

				String[] usernames = new String[mMessages.size()];
				int i = 0;
				for(ParseObject message : mMessages) {
					usernames[i] = message.getString(ParseConstants.KEY_SENDER_NAME);
					i++;
				}
				if (getListView().getAdapter() == null) {
					MessageAdapter adapter = new MessageAdapter(
							getListView().getContext(), 
							mMessages);
					setListAdapter(adapter);
				}
				else {
					// refill the adapter!
					((MessageAdapter)getListView().getAdapter()).refill(mMessages);
				}
			}
		}
	});
}
 
开发者ID:NagabhushanS,项目名称:AmazingFriends,代码行数:38,代码来源:InboxFragment.java

示例4: refreshAdapter

import com.parse.ParseQuery; //导入方法依赖的package包/类
public void refreshAdapter(final boolean afterAdd){
    ParseQuery<Guest> query = ParseQuery.getQuery("Guest");

    query.whereEqualTo("partyID",id);
    query.addDescendingOrder("createdAt");
    if(afterAdd){
        query.fromLocalDatastore();
    }
    query.findInBackground(new FindCallback<Guest>() {
        @Override
        public void done(List<Guest> parseObjects, ParseException e) {
            if (e == null) {
                Log.d("STATUS FINDING","SUCCESS " + parseObjects.size());




                    if(afterAdd){
                        Log.d("CLICK",click + "");
                        adapter.insert(parseObjects.get(parseObjects.size()-1),0);


                    }else {
                        adapter.clear();
                        adapter.addAll(parseObjects);
                    }
                    adapter.notifyDataSetChanged();
                    Log.d("LENGTH OF INFO", info.size() + "");



            }
            else{
                Log.e("STATUS FINDING", "ERROR: " + e.getMessage());
            }
        }
    });
}
 
开发者ID:sagargarg,项目名称:barbot,代码行数:39,代码来源:AddGuestActivity.java


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