Skip to content

feat: Bootstrap ContactCard Compose module with resources - #819

Open
Elouan1411 wants to merge 7 commits into
protected/v-cardfrom
vcard-2-setup-module
Open

feat: Bootstrap ContactCard Compose module with resources#819
Elouan1411 wants to merge 7 commits into
protected/v-cardfrom
vcard-2-setup-module

Conversation

@Elouan1411

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Ui/Compose/ContactCard/src/main/AndroidManifest.xml Fixed
Comment thread Ui/Compose/ContactCard/src/main/AndroidManifest.xml Fixed
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch from 0bafc8e to aae8c4b Compare July 24, 2026 06:59
@Elouan1411 Elouan1411 changed the title feat: Bootstrap ContactCard Compose module with resources  feat: Bootstrap ContactCard Compose module with resources Jul 24, 2026
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch 2 times, most recently from 4f33bc9 to 18b6d27 Compare July 24, 2026 07:26
@Elouan1411
Elouan1411 requested a review from Copilot July 24, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Bootstraps the ContactCard Compose module with sharing support, localized resources, and visual assets.

Changes:

  • Adds vCard creation and secure sharing through FileProvider.
  • Adds localized strings and light/dark drawable assets.
  • Registers module dependencies and catalog coordinates.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Ui/Compose/ContactCard/build.gradle.kts Configures module dependencies.
Ui/Compose/ContactCard/src/main/AndroidManifest.xml Registers the file provider.
Ui/Compose/ContactCard/src/main/kotlin/.../ContactCardFileProvider.kt Defines the sharing provider.
Ui/Compose/ContactCard/src/main/kotlin/.../ContactCardShareExt.kt Creates and shares vCards.
Ui/Compose/ContactCard/src/main/res/xml/contact_card_paths.xml Exposes the card cache directory.
Ui/Compose/ContactCard/src/main/res/values/strings.xml Adds default English strings.
Ui/Compose/ContactCard/src/main/res/values-da/strings.xml Adds Danish translations.
Ui/Compose/ContactCard/src/main/res/values-de/strings.xml Adds German translations.
Ui/Compose/ContactCard/src/main/res/values-el/strings.xml Adds Greek translations.
Ui/Compose/ContactCard/src/main/res/values-es/strings.xml Adds Spanish translations.
Ui/Compose/ContactCard/src/main/res/values-fi/strings.xml Adds Finnish translations.
Ui/Compose/ContactCard/src/main/res/values-fr/strings.xml Adds French translations.
Ui/Compose/ContactCard/src/main/res/values-it/strings.xml Adds Italian translations.
Ui/Compose/ContactCard/src/main/res/values-nb/strings.xml Adds Norwegian translations.
Ui/Compose/ContactCard/src/main/res/values-nl/strings.xml Adds Dutch translations.
Ui/Compose/ContactCard/src/main/res/values-pl/strings.xml Adds Polish translations.
Ui/Compose/ContactCard/src/main/res/values-pt/strings.xml Adds Portuguese translations.
Ui/Compose/ContactCard/src/main/res/values-sv/strings.xml Adds Swedish translations.
Ui/Compose/ContactCard/src/main/res/drawable/onboarding_vcard.xml Adds the light onboarding illustration.
Ui/Compose/ContactCard/src/main/res/drawable-night/onboarding_vcard.xml Adds the dark onboarding illustration.
Ui/Compose/ContactCard/src/main/res/drawable/ic_back_wave.xml Adds the background wave.
Ui/Compose/ContactCard/src/main/res/drawable/ic_bin.xml Adds the delete icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_check.xml Adds the check icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_cross.xml Adds the close icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_facebook.xml Adds the Facebook icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_instagram.xml Adds the Instagram icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_link.xml Adds the link icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_linkedin.xml Adds the LinkedIn icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_pencil.xml Adds the edit icon.
Ui/Compose/ContactCard/src/main/res/drawable/ic_x.xml Adds the X icon.
settings.gradle.kts Includes the new module.
Network/build.gradle.kts Exposes OkHttp through Network.
gradle/core.versions.toml Adds lifecycle, Qrose, and module aliases.

Comment thread Ui/Compose/ContactCard/build.gradle.kts Outdated
Comment on lines +65 to +73
val contentLength = body.contentLength()
if (contentLength > MAX_AVATAR_SIZE) return@runCatching null to null

val mimeType = body.contentType()?.subtype?.uppercase()
val bytes = body.bytes()

if (bytes.size > MAX_AVATAR_SIZE) return@runCatching null to null

val base64 = Base64.encodeToString(bytes, Base64.NO_WRAP)
Comment thread Ui/Compose/ContactCard/build.gradle.kts
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch 2 times, most recently from a55afe1 to 8ed3e8b Compare August 12, 2026 12:33
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch from 8ed3e8b to 64b04b5 Compare August 13, 2026 06:53
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch from 64b04b5 to 1c2af37 Compare August 13, 2026 06:57
Base automatically changed from vcard-1-data-auth-model to protected/v-card August 13, 2026 07:26
@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch from 1c2af37 to 17e12c7 Compare August 13, 2026 07:26
Comment thread gradle/core.versions.toml
mockk = "1.14.6"
navigation = "2.9.6"
nav3Core = "1.1.1"
qrose = "1.1.2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have the same library in ST. We'll have to update it after this is merged.

private const val CONTACT_CARD_DIRECTORY = "attachments_cache"
private const val CONTACT_CARD_FILE_PREFIX = "contact_card_"
private const val CONTACT_CARD_FILE_SUFFIX = ".vcf"
private const val FILE_NAME_CONNECTOR = "_"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Usually, we create constants only if it's used multiple times. Which is not the case here.

import okhttp3.Request
import java.io.File

private const val MAX_AVATAR_SIZE = 5 * 1024 * 1024 // 5 MB

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But you can keep this one.

android:width="375dp"
android:height="426dp"
android:viewportWidth="375"
android:viewportHeight="426">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems to be very big for an icon ?

@Elouan1411 Elouan1411 Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's not an icon, it's a background for the onboarding screen. Other waves already exist with the "ic" prefix. Is it okay to leave it as is?

android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be 24dp ? The other icons are in 24dp.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm, same icon in /main-kMail/app/src/main/res/drawable/ic_check.xml with 16

buildFeatures {
compose = true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

Comment thread Network/build.gradle.kts
}

dependencies {
api(core.okhttp)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was that necessary ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is no longer necessary

implementation(project(":Network"))
api(core.androidx.lifecycle.viewmodel.ktx)
api(project(":Auth"))
implementation(project(":Avatar"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Put all the project together.

Comment thread LICENSES.md
# Open Source Licenses

Infomaniak Android Core declares the following notable open source libraries as runtime dependencies (build-time and test-only dependencies are excluded). This list may not be exhaustive.
Infomaniak Android Core declares the following notable open source libraries as runtime dependencies (build-time and test-only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why the whole file changed ?

@Elouan1411 Elouan1411 Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just format it and add qrose

@Elouan1411
Elouan1411 force-pushed the vcard-2-setup-module branch 3 times, most recently from fe9a6b6 to 1c2af37 Compare August 13, 2026 16:09
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants