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

[AND-277] Avatar component factories #5596

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

andremion
Copy link
Collaborator

@andremion andremion commented Jan 28, 2025

🎯 Goal

Provide default factories for the avatar components: UserAvatar, ChannelAvatar, and Avatar

Unrelated changes

  • Add André Rêgo demo user.
  • Replace André Mion preview user with André Rêgo.
  • Factory for the channel list header.
  • Replace UserAvatar usages with Avatar when showOnlineIndicator = false, which means we can use Avatar directly.

🎨 UI Changes

Custom Avatar Custom ChannelAvatar
Screen_recording_20250131_162928.webm
Screen_recording_20250131_163229.webm
Custom GroupAvatar Custom UserAvatar
Screen_recording_20250131_163536.webm
Screen_recording_20250131_163758.webm

Copy link
Contributor

github-actions bot commented Jan 28, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.17 MB 3.17 MB 0.00 MB 🟢
stream-chat-android-offline 3.38 MB 3.38 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.86 MB 7.86 MB 0.00 MB 🟢
stream-chat-android-compose 8.73 MB 8.73 MB 0.00 MB 🟢

@andremion andremion force-pushed the AND-277-useravatar-stateless-component branch from a4cbedd to c98c7c8 Compare January 28, 2025 16:16
@andremion andremion marked this pull request as ready for review January 28, 2025 16:16
@andremion andremion requested a review from a team as a code owner January 28, 2025 16:16
@andremion andremion force-pushed the AND-277-useravatar-stateless-component branch from c98c7c8 to 2100b11 Compare January 29, 2025 08:36
@andremion andremion added enhancement New feature or request compose Jetpack Compose labels Jan 29, 2025
@andremion andremion force-pushed the AND-277-useravatar-stateless-component branch from 8a82f0b to 3ee688a Compare January 30, 2025 13:19
@andremion andremion force-pushed the AND-277-useravatar-stateless-component branch from 3ee688a to c9eb9df Compare January 31, 2025 14:53
@andremion andremion marked this pull request as draft January 31, 2025 14:54
Comment on lines 140 to 141
UserAvatar(
Avatar(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we switching from UserAvatar to Avatar?
Shouldn't we use the factory here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced all calls from UserAvatar to Avatar when showOnlineIndicator = false
That means it's not meant to show the online indicator at any case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Avatar factory is not done yet. As I mentioned, it's a WIP. PR is a draft yet

Comment on lines 84 to 86
UserAvatar(
Avatar(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.
Shouldn't we use ChatTheme.componentFactory.UserAvatar()?? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answered above 🙂

@andremion andremion force-pushed the AND-277-useravatar-stateless-component branch from c9eb9df to 44388f2 Compare January 31, 2025 16:25
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
53.7% Coverage on New Code (required ≥ 80%)
14.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@andremion andremion marked this pull request as ready for review January 31, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compose Jetpack Compose enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants