use of in.testpress.testpress.models.Comment 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;
}
use of in.testpress.testpress.models.Comment in project android by testpress.
the class CommentsListAdapter method onBindViewHolder.
@SuppressLint({ "SetTextI18n", "DefaultLocale" })
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
if (viewHolder instanceof CommentsViewHolder) {
final CommentsViewHolder holder = (CommentsViewHolder) viewHolder;
Comment comment = comments.get(position);
imageLoader.displayImage(comment.getUser().getMediumImage(), holder.userImage, options);
if (comment.getUser().getMediumImage().isEmpty()) {
holder.userImage.setColorFilter(Color.parseColor("#888888"));
} else {
holder.userImage.clearColorFilter();
}
holder.userName.setText(comment.getUser().getDisplayName());
Spanned htmlSpan = Html.fromHtml(comment.getComment(), new UILImageGetter(holder.comment, activity), null);
ZoomableImageString zoomableImageQuestion = new ZoomableImageString(activity);
holder.comment.setText(zoomableImageQuestion.convertString(htmlSpan));
holder.comment.setMovementMethod(LinkMovementMethod.getInstance());
updateTimeSpan(comment, holder);
holder.userName.setTypeface(TestpressSdk.getRubikMediumFont(activity));
ViewUtils.setTypeface(new TextView[] { holder.submitDate, holder.comment }, TestpressSdk.getRubikRegularFont(activity));
}
}
Aggregations