Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a Share vCard feature that allows users to export and share their Gravatar profile as a vCard file. The implementation includes QR code display for quick sharing and a dedicated share button for traditional file sharing.
- Adds vCard photo support with Base64 encoding for avatar images
- Implements file sharing functionality with proper Android FileProvider integration
- Creates utility classes for drawable processing and vCard file creation
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| VCard.kt | Enhanced to support photo field with Base64 encoding and conditional photo inclusion |
| ShareViewModel.kt | Added share functionality with drawable loading and vCard file creation |
| ShareUiState.kt | Added avatar drawable state for photo inclusion in vCard |
| ShareScreen.kt | Integrated share action handling and vCard file sharing intent |
| ShareHeader.kt | Added share button UI component |
| FileUtils.kt | Added vCard file creation functionality |
| DrawableUtils.kt | New utility for downloading drawables and Base64 conversion |
| Various test files | Added comprehensive test coverage for new functionality |
homeUi/src/main/kotlin/com/gravatar/app/homeUi/presentation/DrawableUtils.kt
Show resolved
Hide resolved
homeUi/src/main/kotlin/com/gravatar/app/homeUi/presentation/home/share/model/VCard.kt
Outdated
Show resolved
Hide resolved
homeUi/src/main/kotlin/com/gravatar/app/homeUi/presentation/home/share/ShareViewModel.kt
Outdated
Show resolved
Hide resolved
homeUi/src/main/kotlin/com/gravatar/app/homeUi/presentation/FileUtils.kt
Show resolved
Hide resolved
homeUi/src/main/kotlin/com/gravatar/app/homeUi/presentation/home/share/ShareAction.kt
Outdated
Show resolved
Hide resolved
etoledom
left a comment
There was a problem hiding this comment.
Looking great!
Tested sharing over WhatsApp and Signal. Though is very little info what WhatsApp parses, its out of our control. Similar case with Signal.
I also tested opening the shared .vcf file (via email) and the avatar is there as expected 👍
Note: Probably not related to this PR. I noticed that the location is not being shared neither via QR nor Share option.
Added via #96 |
d194219 to
e4c8956
Compare
Good catch! Thanks |
Description
This PR implements the Share vCard option in the Share Screen. In this case, when the user shares their contact, we want to include in the
.VCFthe currently selected avatar.The Gravatar App should open the system's share sheet showing all the apps that accept that file.
For the file name, we are using the
Display Name.Different apps handle that file in different ways. Some messaging apps parse the VCF and present it in a concrete way. For example, WhatsApp presents the contact in the conversation, but as we are not including the
FN, they use theORGinstead ofNicknameorN. (cc: @pinarol)When we try to add the contact to the agenda from those apps, sometimes we lose the photo or other data. I don't think we can do much about that :(
However, when adding the contact using the file, we can see the avatar:
Testing Steps
Note: As each app handles the VCF file differently, please feel free to comment on unexpected behaviours and we'll see what we can do (if any).