diff options
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java | 12 |
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 { |