Cleaning up

This commit is contained in:
Mario Danic 2018-10-24 00:43:56 +02:00
parent e300f73483
commit 8ff04879e5

View file

@ -123,6 +123,9 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
holder.contactDisplayName.setText(participant.getName()); 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")) { if (TextUtils.isEmpty(participant.getSource()) || participant.getSource().equals("users")) {
GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
participant.getUserId(), R.dimen.avatar_size), new LazyHeaders.Builder() participant.getUserId(), R.dimen.avatar_size), new LazyHeaders.Builder()
@ -130,8 +133,6 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
.setHeader("User-Agent", ApiUtils.getUserAgent()) .setHeader("User-Agent", ApiUtils.getUserAgent())
.build()); .build());
int avatarSize = Math.round(NextcloudTalkApplication
.getSharedApplication().getResources().getDimension(R.dimen.avatar_size));
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
.asBitmap() .asBitmap()
@ -142,7 +143,6 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
.apply(RequestOptions.bitmapTransform(new CircleCrop())) .apply(RequestOptions.bitmapTransform(new CircleCrop()))
.into(holder.avatarFlipView.getFrontImageView()); .into(holder.avatarFlipView.getFrontImageView());
} else if (participant.getSource().equals("groups")) { } else if (participant.getSource().equals("groups")) {
int avatarSize = Math.round(NextcloudTalkApplication.getSharedApplication().getApplicationContext().getResources().getDimension(R.dimen.avatar_size));
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
.asBitmap() .asBitmap()