stream-chat-android
stream-chat-android copied to clipboard
Unable to change/set UserAvatarView scale type
Describe the bug Currently I cant make UserAvatarView scaled center cropped
SDK version
- 6.0.4
To Reproduce Steps to reproduce the behavior:
- Go to 'ChannelListView.'
Expected behavior There should be option to set preferred scale type by styles or by attribute, and also I think default scale type of UserAvatarView must be ScaleType.CENTER_CROP.
Device:
- Vendor and model: Pixel 7
- Android version: 13
Screenshots
Any updates?
Hello @Testtaccount
Currently the UserAvatarView doesn't expose this attribute, but you should be able to provide a custom UserAvatarRenderer and set ScaleType.CENTER_CROP to the target.
Something like:
ChatUI.userAvatarRenderer = UserAvatarRenderer { _, user, target ->
target.scaleType = ImageView.ScaleType.CENTER_CROP
target.setAvatar(avatar = user.image)
}