mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
Merge pull request #6528 from nextcloud/federatedIcon
add ROOM handling for sharees
This commit is contained in:
commit
3a324f11e6
1 changed files with 49 additions and 24 deletions
|
@ -433,30 +433,53 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
avatar.setImageResource(R.drawable.ic_people);
|
avatar.setImageResource(R.drawable.ic_people);
|
||||||
ThemeUtils.setIconColor(avatar.getDrawable());
|
ThemeUtils.setIconColor(avatar.getDrawable());
|
||||||
} else {
|
} else {
|
||||||
if (sharee.getShareType().equals(ShareType.GROUP)) {
|
switch (sharee.getShareType()) {
|
||||||
try {
|
case GROUP:
|
||||||
avatar.setImageDrawable(
|
try {
|
||||||
TextDrawable.createAvatarByUserId(sharee.getUserId(), avatarRadius));
|
avatar.setImageDrawable(TextDrawable.createAvatarByUserId(sharee.getUserId(),
|
||||||
} catch (Exception e) {
|
avatarRadius));
|
||||||
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
|
} catch (Exception e) {
|
||||||
avatar.setImageResource(R.drawable.ic_people);
|
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
|
||||||
|
avatar.setImageResource(R.drawable.ic_people);
|
||||||
|
ThemeUtils.setIconColor(avatar.getDrawable());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROOM:
|
||||||
|
try {
|
||||||
|
if (!TextUtils.isEmpty(sharee.getDisplayName())) {
|
||||||
|
avatar.setImageDrawable(
|
||||||
|
TextDrawable.createNamedAvatar(sharee.getDisplayName(), avatarRadius));
|
||||||
|
} else {
|
||||||
|
avatar.setImageDrawable(
|
||||||
|
TextDrawable.createAvatarByUserId(sharee.getUserId(), avatarRadius));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
|
||||||
|
avatar.setImageResource(R.drawable.ic_people);
|
||||||
|
ThemeUtils.setIconColor(avatar.getDrawable());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CIRCLE:
|
||||||
|
avatar.setImageResource(R.drawable.ic_circles);
|
||||||
ThemeUtils.setIconColor(avatar.getDrawable());
|
ThemeUtils.setIconColor(avatar.getDrawable());
|
||||||
}
|
break;
|
||||||
} else if (sharee.getShareType().equals(ShareType.CIRCLE)) {
|
|
||||||
avatar.setImageResource(R.drawable.ic_circles);
|
default:
|
||||||
ThemeUtils.setIconColor(avatar.getDrawable());
|
if (sharee.getUserId().contains("@")) {
|
||||||
} else if (sharee.getUserId().contains("@")) {
|
showFederatedShareAvatar(sharee.getUserId(), avatarRadius, resources, avatar);
|
||||||
showFederatedShareAvatar(sharee.getUserId(), avatarRadius, resources, avatar);
|
} else {
|
||||||
} else {
|
avatar.setTag(sharee);
|
||||||
avatar.setTag(sharee);
|
DisplayUtils.setAvatar(user,
|
||||||
DisplayUtils.setAvatar(user,
|
sharee.getUserId(),
|
||||||
sharee.getUserId(),
|
sharee.getDisplayName(),
|
||||||
sharee.getDisplayName(),
|
this,
|
||||||
this,
|
avatarRadius,
|
||||||
avatarRadius,
|
resources,
|
||||||
resources,
|
avatar,
|
||||||
avatar,
|
activity);
|
||||||
activity);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,7 +604,9 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
placeholder = TextDrawable.createAvatarByUserId(userId, avatarRadius);
|
placeholder = TextDrawable.createAvatarByUserId(userId, avatarRadius);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
|
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
|
||||||
placeholder = ResourcesCompat.getDrawable(resources, R.drawable.account_circle_white, null);
|
placeholder = ThemeUtils.tintDrawable(ResourcesCompat.getDrawable(resources,
|
||||||
|
R.drawable.account_circle_white, null),
|
||||||
|
R.color.black);
|
||||||
}
|
}
|
||||||
|
|
||||||
avatar.setTag(null);
|
avatar.setTag(null);
|
||||||
|
|
Loading…
Reference in a new issue