-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add email contact picker when sending by email #620
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
Open
amariaux
wants to merge
11
commits into
main
Choose a base branch
from
contact-picker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0c594d9
feat: Add email contact picker when sending by email
aymericmariaux ad26e03
fix: Delete comment and fix one case
aymericmariaux 47ec65a
fix: Hardcoded string and wrong accessibility content description
aymericmariaux 8ca35f1
fix: Delete unused variable
aymericmariaux 7e3ef4f
fix: Translation using ' instead of ’
aymericmariaux 7f5d268
fix: Add exception handling when launching contact picker, null safet…
aymericmariaux bf12b64
chore: Clean code
aymericmariaux c9db984
fix: Add check getting column index
aymericmariaux aa79cf0
refactor: Split contact picker logic into smaller subfunctions
aymericmariaux c3b23e7
chore: Remove useless imports
aymericmariaux f610f42
refactor: Fix dispatchers, remove unused imports and unnecessary coro…
aymericmariaux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/PersonsCircleAdd.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| package com.infomaniak.swisstransfer.ui.images.icons | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.PathFillType.Companion.NonZero | ||
| import androidx.compose.ui.graphics.SolidColor | ||
| import androidx.compose.ui.graphics.StrokeCap.Companion.Butt | ||
| import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.graphics.vector.ImageVector.Builder | ||
| import androidx.compose.ui.graphics.vector.group | ||
| import androidx.compose.ui.graphics.vector.path | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.infomaniak.swisstransfer.ui.images.AppImages | ||
| import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons | ||
| import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound | ||
| import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound | ||
|
|
||
| val AppIcons.PersonsCircleAdd: ImageVector | ||
| get() { | ||
| if (_personsCircleAdd != null) { | ||
| return _personsCircleAdd!! | ||
| } | ||
| _personsCircleAdd = Builder( | ||
| name = "PersonsCircleAdd", | ||
| defaultWidth = 24.0.dp, | ||
| defaultHeight = 24.0.dp, | ||
| viewportWidth = 24.0f, | ||
| viewportHeight = 24.0f, | ||
| ).apply { | ||
| group { | ||
| path( | ||
| fill = SolidColor(Color(0xFF9F9F9F)), | ||
| stroke = null, | ||
| strokeLineWidth = 0.0f, | ||
| strokeLineCap = Butt, | ||
| strokeLineJoin = Miter, | ||
| strokeLineMiter = 4.0f, | ||
| pathFillType = NonZero, | ||
| ) { | ||
| moveTo(18.0f, 12.0f) | ||
| curveTo(19.591f, 12.0f, 21.117f, 12.633f, 22.242f, 13.758f) | ||
| curveTo(23.367f, 14.883f, 24.0f, 16.409f, 24.0f, 18.0f) | ||
| curveTo(24.0f, 19.591f, 23.367f, 21.117f, 22.242f, 22.242f) | ||
| curveTo(21.117f, 23.367f, 19.591f, 24.0f, 18.0f, 24.0f) | ||
| curveTo(16.409f, 24.0f, 14.883f, 23.367f, 13.758f, 22.242f) | ||
| curveTo(12.633f, 21.117f, 12.0f, 19.591f, 12.0f, 18.0f) | ||
| curveTo(12.0f, 16.409f, 12.633f, 14.883f, 13.758f, 13.758f) | ||
| curveTo(14.883f, 12.633f, 16.409f, 12.0f, 18.0f, 12.0f) | ||
| close() | ||
| moveTo(18.0f, 14.0f) | ||
| curveTo(17.586f, 14.0f, 17.25f, 14.336f, 17.25f, 14.75f) | ||
| verticalLineTo(17.25f) | ||
| horizontalLineTo(14.75f) | ||
| curveTo(14.336f, 17.25f, 14.0f, 17.586f, 14.0f, 18.0f) | ||
| curveTo(14.0f, 18.414f, 14.336f, 18.75f, 14.75f, 18.75f) | ||
| horizontalLineTo(17.25f) | ||
| verticalLineTo(21.25f) | ||
| curveTo(17.25f, 21.664f, 17.586f, 22.0f, 18.0f, 22.0f) | ||
| curveTo(18.414f, 22.0f, 18.75f, 21.664f, 18.75f, 21.25f) | ||
| verticalLineTo(18.75f) | ||
| horizontalLineTo(21.25f) | ||
| curveTo(21.664f, 18.75f, 22.0f, 18.414f, 22.0f, 18.0f) | ||
| curveTo(22.0f, 17.586f, 21.664f, 17.25f, 21.25f, 17.25f) | ||
| horizontalLineTo(18.75f) | ||
| verticalLineTo(14.75f) | ||
| curveTo(18.75f, 14.336f, 18.414f, 14.0f, 18.0f, 14.0f) | ||
| close() | ||
| } | ||
| path( | ||
| fill = SolidColor(Color(0x00000000)), | ||
| stroke = SolidColor(Color(0xFF9F9F9F)), | ||
| strokeLineWidth = 1.5f, | ||
| strokeLineCap = strokeCapRound, | ||
| strokeLineJoin = strokeJoinRound, | ||
| strokeLineMiter = 4.0f, | ||
| pathFillType = NonZero, | ||
| ) { | ||
| moveTo(13.071f, 10.047f) | ||
| curveTo(13.58f, 9.824f, 14.134f, 9.705f, 14.7f, 9.705f) | ||
| curveTo(15.601f, 9.705f, 16.47f, 10.004f, 17.175f, 10.548f) | ||
| moveTo(2.85f, 4.046f) | ||
| curveTo(2.85f, 4.92f, 3.197f, 5.758f, 3.816f, 6.377f) | ||
| curveTo(4.435f, 6.995f, 5.274f, 7.342f, 6.15f, 7.342f) | ||
| curveTo(7.025f, 7.342f, 7.864f, 6.995f, 8.483f, 6.377f) | ||
| curveTo(9.102f, 5.758f, 9.449f, 4.92f, 9.449f, 4.046f) | ||
| curveTo(9.449f, 3.172f, 9.102f, 2.333f, 8.483f, 1.715f) | ||
| curveTo(7.864f, 1.097f, 7.025f, 0.75f, 6.15f, 0.75f) | ||
| curveTo(5.274f, 0.75f, 4.435f, 1.097f, 3.816f, 1.715f) | ||
| curveTo(3.197f, 2.333f, 2.85f, 3.172f, 2.85f, 4.046f) | ||
| close() | ||
| moveTo(12.225f, 6.216f) | ||
| curveTo(12.225f, 6.872f, 12.486f, 7.501f, 12.95f, 7.964f) | ||
| curveTo(13.414f, 8.428f, 14.044f, 8.688f, 14.7f, 8.688f) | ||
| curveTo(15.356f, 8.688f, 15.986f, 8.428f, 16.45f, 7.964f) | ||
| curveTo(16.914f, 7.501f, 17.175f, 6.872f, 17.175f, 6.216f) | ||
| curveTo(17.175f, 5.561f, 16.914f, 4.932f, 16.45f, 4.468f) | ||
| curveTo(15.986f, 4.005f, 15.356f, 3.744f, 14.7f, 3.744f) | ||
| curveTo(14.044f, 3.744f, 13.414f, 4.005f, 12.95f, 4.468f) | ||
| curveTo(12.486f, 4.932f, 12.225f, 5.561f, 12.225f, 6.216f) | ||
| close() | ||
| moveTo(0.75f, 13.75f) | ||
| curveTo(0.75f, 12.32f, 1.319f, 10.948f, 2.332f, 9.936f) | ||
| curveTo(3.344f, 8.925f, 4.718f, 8.357f, 6.15f, 8.357f) | ||
| curveTo(7.582f, 8.357f, 8.955f, 8.925f, 9.968f, 9.936f) | ||
| curveTo(10.98f, 10.948f, 11.549f, 12.32f, 11.549f, 13.75f) | ||
| horizontalLineTo(0.75f) | ||
| close() | ||
| } | ||
| } | ||
| }.build() | ||
| return _personsCircleAdd!! | ||
| } | ||
|
|
||
| private var _personsCircleAdd: ImageVector? = null | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun Preview() { | ||
| Box { | ||
| Image( | ||
| imageVector = AppIcons.PersonsCircleAdd, | ||
| contentDescription = null, | ||
| modifier = Modifier.size(AppImages.previewSize) | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The
selectContactcallback signature includesContext, which propagates Android framework types through the composable tree and makes the API harder to reuse/test. If the ViewModel injects@ApplicationContext(see comment in PickFilesViewModel), this callback can likely be simplified to only pass the pickedUri(or a list of Uris).