@@ -460,6 +460,7 @@ public static void setAvatar(@NonNull User user, @NonNull String userId, AvatarG
460460 * @param avatarRadius the avatar radius
461461 * @param resources reference for density information
462462 * @param callContext which context is called to set the generated avatar
463+ * @param context general context
463464 */
464465 public static void setAvatar (@ NonNull User user ,
465466 @ NonNull String userId ,
@@ -469,6 +470,30 @@ public static void setAvatar(@NonNull User user,
469470 Resources resources ,
470471 Object callContext ,
471472 Context context ) {
473+ setAvatar (user , userId , displayName , listener , avatarRadius , resources , callContext , context , 0 );
474+ }
475+
476+ /**
477+ * fetches and sets the avatar of the given account in the passed callContext
478+ *
479+ * @param user the account to be used to connect to server
480+ * @param userId the userId which avatar should be set
481+ * @param displayName displayName used to generate avatar with first char, only used as fallback
482+ * @param avatarRadius the avatar radius
483+ * @param resources reference for density information
484+ * @param callContext which context is called to set the generated avatar
485+ * @param context general context
486+ * @param avatarBorder value in case the avatar has a border, like in the case of the AvatarGroupLayout
487+ */
488+ public static void setAvatar (@ NonNull User user ,
489+ @ NonNull String userId ,
490+ String displayName ,
491+ AvatarGenerationListener listener ,
492+ float avatarRadius ,
493+ Resources resources ,
494+ Object callContext ,
495+ Context context ,
496+ int avatarBorder ) {
472497 if (callContext instanceof View v ) {
473498 v .setContentDescription (String .valueOf (user .toPlatformAccount ().hashCode ()));
474499 }
@@ -495,7 +520,8 @@ public static void setAvatar(@NonNull User user,
495520 // if no one exists, show colored icon with initial char
496521 if (avatar == null ) {
497522 try {
498- avatar = TextDrawable .createAvatarByUserId (displayName , avatarRadius );
523+ avatar = TextDrawable .createAvatarByUserId (displayName ,
524+ (avatarRadius - avatarBorder ));
499525 } catch (Exception e ) {
500526 Log_OC .e (TAG , "Error calculating RGB value for active account icon." , e );
501527 avatar = ResourcesCompat .getDrawable (resources ,
0 commit comments