diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java index 27d846858..112276972 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java @@ -123,6 +123,9 @@ public class UserItem extends AbstractFlexibleItem holder.contactDisplayName.setText(participant.getName()); } + int avatarSize = Math.round(NextcloudTalkApplication + .getSharedApplication().getResources().getDimension(R.dimen.avatar_size)); + if (TextUtils.isEmpty(participant.getSource()) || participant.getSource().equals("users")) { GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), participant.getUserId(), R.dimen.avatar_size), new LazyHeaders.Builder() @@ -130,8 +133,6 @@ public class UserItem extends AbstractFlexibleItem .setHeader("User-Agent", ApiUtils.getUserAgent()) .build()); - int avatarSize = Math.round(NextcloudTalkApplication - .getSharedApplication().getResources().getDimension(R.dimen.avatar_size)); GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) .asBitmap() @@ -142,7 +143,6 @@ public class UserItem extends AbstractFlexibleItem .apply(RequestOptions.bitmapTransform(new CircleCrop())) .into(holder.avatarFlipView.getFrontImageView()); } else if (participant.getSource().equals("groups")) { - int avatarSize = Math.round(NextcloudTalkApplication.getSharedApplication().getApplicationContext().getResources().getDimension(R.dimen.avatar_size)); GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) .asBitmap()