feat: Bootstrap ContactCard Compose module with resources - #819
feat: Bootstrap ContactCard Compose module with resources#819Elouan1411 wants to merge 7 commits into
Conversation
0bafc8e to
aae8c4b
Compare
4f33bc9 to
18b6d27
Compare
There was a problem hiding this comment.
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. |
| 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) |
a55afe1 to
8ed3e8b
Compare
8ed3e8b to
64b04b5
Compare
64b04b5 to
1c2af37
Compare
1c2af37 to
17e12c7
Compare
| mockk = "1.14.6" | ||
| navigation = "2.9.6" | ||
| nav3Core = "1.1.1" | ||
| qrose = "1.1.2" |
There was a problem hiding this comment.
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 = "_" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
But you can keep this one.
| android:width="375dp" | ||
| android:height="426dp" | ||
| android:viewportWidth="375" | ||
| android:viewportHeight="426"> |
There was a problem hiding this comment.
Seems to be very big for an icon ?
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
I think it should be 24dp ? The other icons are in 24dp.
There was a problem hiding this comment.
hmm, same icon in /main-kMail/app/src/main/res/drawable/ic_check.xml with 16
| buildFeatures { | ||
| compose = true | ||
| } | ||
|
|
| } | ||
|
|
||
| dependencies { | ||
| api(core.okhttp) |
There was a problem hiding this comment.
It is no longer necessary
| implementation(project(":Network")) | ||
| api(core.androidx.lifecycle.viewmodel.ktx) | ||
| api(project(":Auth")) | ||
| implementation(project(":Avatar")) |
There was a problem hiding this comment.
Put all the project together.
| # 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 |
There was a problem hiding this comment.
Why the whole file changed ?
There was a problem hiding this comment.
Just format it and add qrose
fe9a6b6 to
1c2af37
Compare
|



No description provided.