Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

shamim-emon
Copy link
Collaborator

@shamim-emon shamim-emon commented Oct 1, 2025

Implementation Highlights

  • Contact / Avatar Retrieval

    • Updated ContactRepository interface to expose a getPhotoUri(emailAddress: String): Uri?. (Added methods)
    • In CachingContactRepository, implemented this method to extract photoUri from a cached contact record.
  • Dependency & Build Updates

    • Added dependencies for avatar feature modules (feature.account.avatar.api and feature.account.avatar.impl) in legacy/ui/legacy/build.gradle.kts.
  • Preview / Debug UI

    • In MessageItemContentPreview.kt, updated the preview composables to include fake avatar / monogram providers so that previews render avatars.
  • ContactPhotoLoader Cleanup

    • Removed a redundant local getPhotoUri(...) implementation, redirecting to the unified ContactRepository.getPhotoUri(...). (Simplifies and centralizes contact-photo logic) .
  • Adapter / Fragment Wiring

    • MessageListAdapter now accepts ContactRepository and AvatarMonogramCreator and passes them down to ComposableMessageViewHolder.
    • In MessageListFragment, injected contactRepository and avatarMonogramCreator and passed them into the adapter construction.
    • ComposableMessageViewHolder was updated to accept and use an onAvatarClick callback alongside the existing onClick / onLongClick.
    • When binding, the composable view is given contact + avatar monogram info so it can render the correct avatar.

NOTE: This feature is behind feature flag: use_compose_for_message_list_items.

@shamim-emon shamim-emon requested a review from a team as a code owner October 1, 2025 17:52
@shamim-emon shamim-emon requested a review from wmontwe October 1, 2025 17:52
@wmontwe wmontwe changed the title Add Avatar to Message List Content feat(message-list): add Avatar to MessageListContent Oct 2, 2025
@wmontwe wmontwe added the merge block: soft freeze PR to main is blocked: risky code or feature flag enablement must wait until soft freeze lifts. label Oct 8, 2025
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

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

In contrast to the old image loader, landscapist using coil is able to load the contact picture directly from the contact photo uri.

So instead of handling bitmaps we just need to provide the uri similarly to ContactPhotoLoader.getPhotoUri. Ideally this is either a new method for the ContactRepository or a layer on top that just extracts the photo uri from the contact for a given address.

Instead of reusing the current placeholder, the new design uses two characters from the contact. So the placeholder could be build as composable and avoid the bitmap manipulation.

Box(contentAlignment = Alignment.Center) {
    TextTitleSmall(text = monogram)
}
state=active, type=selected

@shamim-emon shamim-emon force-pushed the fix-issue-9822 branch 3 times, most recently from 9cdf7f2 to 43fc8d5 Compare October 10, 2025 02:16
@shamim-emon shamim-emon requested a review from wmontwe October 10, 2025 02:17
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

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

Thank you. Just some small things left. I think for the next iteration, we need to find a better way to provide details of the design, like measurements, color and size values.

) {
fun loadContactPhoto(emailAddress: String): Bitmap? {
val photoUri = getPhotoUri(emailAddress) ?: return null
val photoUri = contactRepository.getPhotoUri(emailAddress = emailAddress) ?: return null
Copy link
Member

Choose a reason for hiding this comment

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

👍

legacy/ui/legacy/build.gradle.kts Outdated Show resolved Hide resolved
@wmontwe
Copy link
Member

wmontwe commented Oct 10, 2025

Optional: If you like you could also wire the click handling to trigger the message item selection when the avatar is clicked.

Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

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

LGTM and thank you!

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

Labels

merge block: soft freeze PR to main is blocked: risky code or feature flag enablement must wait until soft freeze lifts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add avatar to message list content

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.