Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change/set UserAvatarView scale type #5006

Open
Testtaccount opened this issue Oct 19, 2023 · 3 comments
Open

Unable to change/set UserAvatarView scale type #5006

Testtaccount opened this issue Oct 19, 2023 · 3 comments

Comments

@Testtaccount
Copy link

Describe the bug
Currently I cant make UserAvatarView scaled center cropped

SDK version

  • 6.0.4

To Reproduce
Steps to reproduce the behavior:

  1. 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
photo_5298792146708581507_y

@Testtaccount Testtaccount added the bug Something isn't working label Oct 19, 2023
@Testtaccount
Copy link
Author

Any updates?

@JcMinarro
Copy link
Member

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)
}

@JcMinarro JcMinarro added feature request and removed bug Something isn't working labels Jul 2, 2024
@haykarustamyan
Copy link

This is for header avatar icon only, how to change just channels list item avatar icon scale and not write whole icon generation logic( I mean using ChatUI.channelAvatarRenderer = ChannelAvatarRenderer { ... )?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@JcMinarro @haykarustamyan @Testtaccount and others