Fix issues related to image loading

Resolved some issues related to loading icons of users on community pages
This commit is contained in:
Bazsalanszky 2023-08-05 16:20:33 +02:00
parent 252e00b67a
commit 1d7031f3d4
2 changed files with 2 additions and 2 deletions

View File

@ -476,7 +476,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
((PostDetailBaseViewHolder) holder).mTitleTextView.setText(mPost.getTitle()); ((PostDetailBaseViewHolder) holder).mTitleTextView.setText(mPost.getTitle());
if (mPost.getSubredditNamePrefixed().startsWith("u/")) { if (mPost.getSubredditNamePrefixed().startsWith("u/")) {
if (mPost.getAuthorIconUrl() == null) { if (mPost.getAuthorIconUrl() == null) {
LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase, LemmyUtils.qualifiedUserName2ActorId(mPost.getAuthorNamePrefixed()), mOauthRetrofit, iconImageUrl -> { LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase,mPost.getAuthorNamePrefixed(), mOauthRetrofit, iconImageUrl -> {
if (mActivity != null && getItemCount() > 0) { if (mActivity != null && getItemCount() > 0) {
if (iconImageUrl == null || iconImageUrl.equals("")) { if (iconImageUrl == null || iconImageUrl.equals("")) {
mGlide.load(R.drawable.subreddit_default_icon) mGlide.load(R.drawable.subreddit_default_icon)

View File

@ -1757,7 +1757,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
loadIconListener.loadIconSuccess(subredditOrUserName, iconImageUrl); loadIconListener.loadIconSuccess(subredditOrUserName, iconImageUrl);
}); });
} else { } else {
LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase, LemmyUtils.qualifiedUserName2ActorId(subredditOrUserName), LoadUserData.loadUserData(mExecutor, new Handler(), mRedditDataRoomDatabase, subredditOrUserName,
mRetrofit.getRetrofit(), iconImageUrl -> { mRetrofit.getRetrofit(), iconImageUrl -> {
subredditOrUserIcons.put(subredditOrUserName, iconImageUrl); subredditOrUserIcons.put(subredditOrUserName, iconImageUrl);
loadIconListener.loadIconSuccess(subredditOrUserName, iconImageUrl); loadIconListener.loadIconSuccess(subredditOrUserName, iconImageUrl);