UserAvatarBackground

fun UserAvatarBackground(modifier: Modifier = Modifier, userImage: String?, userName: String?, shape: Shape = VideoTheme.shapes.circle, avatarSize: Dp = VideoTheme.dimens.genericMax, imageScale: ContentScale = ContentScale.Crop, imageDescription: String? = null, imageRequestSize: IntSize = IntSize(DEFAULT_IMAGE_SIZE, DEFAULT_IMAGE_SIZE), @DrawableRes loadingPlaceholder: Int? = LocalAvatarPreviewProvider.getLocalAvatarLoadingPlaceholder(), @DrawableRes previewModePlaceholder: Int = LocalAvatarPreviewProvider.getLocalAvatarPreviewPlaceholder(), textStyle: TextStyle = VideoTheme.typography.titleM, textOffset: DpOffset = DpOffset(0.dp, 0.dp))

Component that displays a user avatar and a background that reflects the avatar.

Parameters

modifier

Modifier used for styling.

userImage

The URL of the image to be displayed. Usually User.image.

userName

The name to be used for the initials fallback. Usually User.name.

shape

The shape of the avatar. CircleShape by default.

avatarSize

The size of the avatar.

imageScale

The scale rule used for the image. Crop by default.

imageDescription

The image content description for accessibility. Null by default.

imageRequestSize

The image size to be requested. Original size by default.

loadingPlaceholder

Placeholder image to be displayed while loading the remote image.

previewModePlaceholder

Placeholder image to be displayed in Compose previews (IDE).

textStyle

The TextStyle to be used for the initials text fallback. The fontSize, fontFamily and fontWeight properties are used. If the font size is too large, it will be gradually decreased automatically.

textOffset

Offset to be applied to the initials text.

See also