Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Implement Share vCard feature#93

Merged
hamorillo merged 3 commits intotrunkfrom
hamorillo/GRA-578
Jul 31, 2025
Merged

Implement Share vCard feature#93
hamorillo merged 3 commits intotrunkfrom
hamorillo/GRA-578

Conversation

@hamorillo
Copy link

@hamorillo hamorillo commented Jul 30, 2025

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 .VCF the currently selected avatar.

The Gravatar App should open the system's share sheet showing all the apps that accept that file.

image

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 the ORG instead of Nickname or N. (cc: @pinarol)

image

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:

image

Testing Steps

  • Launch the app
  • Switch to the Share Screen
  • Click into the Share icon
  • Verify the system share sheet is opened
  • Try to share with different apps (messaging, email, etc.)
  • Save the file locally (for example, sharing the .vcf file with a file explorer)
  • Using the same file explorer, open the file and verify it's imported.

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

@hamorillo hamorillo requested a review from Copilot July 30, 2025 17:03
@hamorillo hamorillo added the enhancement New feature or request label Jul 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@hamorillo hamorillo requested a review from etoledom July 31, 2025 09:13
@hamorillo hamorillo marked this pull request as ready for review July 31, 2025 09:13
Copy link
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

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.

@etoledom
Copy link
Contributor

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

@hamorillo hamorillo force-pushed the hamorillo/GRA-578 branch from d194219 to e4c8956 Compare July 31, 2025 14:00
@hamorillo
Copy link
Author

Note: Probably not related to this PR. I noticed that the location is not being shared neither via QR nor Share option.

Good catch! Thanks

@hamorillo hamorillo merged commit 116c5bd into trunk Jul 31, 2025
10 checks passed
@hamorillo hamorillo deleted the hamorillo/GRA-578 branch July 31, 2025 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants