use of in.testpress.testpress.core.CommentsPager in project android by testpress.
the class PostActivity method getPreviousCommentsPager.
@SuppressLint("SimpleDateFormat")
CommentsPager getPreviousCommentsPager() {
if (previousCommentsPager == null) {
previousCommentsPager = new CommentsPager(getService(), post.getId());
previousCommentsPager.queryParams.put(Constants.Http.ORDER, "-created");
previousCommentsPager.queryParams.put(Constants.Http.UNTIL, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ").format(new Date()));
}
return previousCommentsPager;
}
use of in.testpress.testpress.core.CommentsPager in project android by testpress.
the class PostActivity method getNewCommentsPager.
CommentsPager getNewCommentsPager() {
if (newCommentsPager == null) {
newCommentsPager = new CommentsPager(getService(), post.getId());
}
List<Comment> comments = commentsAdapter.getComments();
if (newCommentsPager.queryParams.isEmpty() && comments.size() != 0) {
Comment latestComment = comments.get(comments.size() - 1);
// noinspection ConstantConditions
newCommentsPager.queryParams.put(Constants.Http.SINCE, latestComment.getCreated());
}
return newCommentsPager;
}
Aggregations