aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
index 2046f5ed..34996b15 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
@@ -402,12 +402,16 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
if (comment.getAuthorIconUrl() == null) {
mFragment.loadIcon(comment.getAuthor(), (authorName, iconUrl) -> {
if (authorName.equals(comment.getAuthor())) {
+ comment.setAuthorIconUrl(iconUrl);
+ }
+
+ Comment currentComment = getCurrentComment(holder);
+ if (currentComment != null && authorName.equals(currentComment.getAuthor())) {
mGlide.load(iconUrl)
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
.error(mGlide.load(R.drawable.subreddit_default_icon)
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
.into(((CommentViewHolder) holder).authorIconImageView);
- comment.setAuthorIconUrl(iconUrl);
}
});
} else {
@@ -529,12 +533,16 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
if (comment.getAuthorIconUrl() == null) {
mFragment.loadIcon(comment.getAuthor(), (authorName, iconUrl) -> {
if (authorName.equals(comment.getAuthor())) {
+ comment.setAuthorIconUrl(iconUrl);
+ }
+
+ Comment currentComment = getCurrentComment(holder);
+ if (currentComment != null && authorName.equals(currentComment.getAuthor())) {
mGlide.load(iconUrl)
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
.error(mGlide.load(R.drawable.subreddit_default_icon)
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
.into(((CommentFullyCollapsedViewHolder) holder).authorIconImageView);
- comment.setAuthorIconUrl(iconUrl);
}
});
} else {