-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(message-list): add Avatar to MessageListContent #9895
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
base: main
Are you sure you want to change the base?
Conversation
c93ebae
to
2229c90
Compare
There was a problem hiding this 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)
}

legacy/ui/legacy/src/debug/kotlin/com/fsck/k9/ui/messagelist/item/MessageItemContentPreview.kt
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Outdated
Show resolved
Hide resolved
9cdf7f2
to
43fc8d5
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
core/android/common/src/main/kotlin/app/k9mail/core/android/common/contact/ContactRepository.kt
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Outdated
Show resolved
Hide resolved
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/item/MessageItemContent.kt
Show resolved
Hide resolved
Optional: If you like you could also wire the click handling to trigger the message item selection when the avatar is clicked. |
43fc8d5
to
2c38254
Compare
2c38254
to
f29d9b3
Compare
f29d9b3
to
eb32b47
Compare
There was a problem hiding this 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!
Implementation Highlights
Contact / Avatar Retrieval
Dependency & Build Updates
Preview / Debug UI
ContactPhotoLoader Cleanup
Adapter / Fragment Wiring
NOTE: This feature is behind feature flag:
use_compose_for_message_list_items
.