From 1eca1fc5e7c3d33d2b593a4a5f83da8c90b11735 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 18 Nov 2024 17:03:57 +0100 Subject: [PATCH] Previous commits --- .../library/filetypes/icons/Archive.kt | 14 ++----------- .../library/filetypes/icons/Points.kt | 14 ++----------- .../library/filetypes/icons/Video.kt | 7 +------ .../ui/components/BottomSheetItem.kt | 5 +++-- .../ui/components/BrandTopAppBar.kt | 6 +++--- .../swisstransfer/ui/components/Buttons.kt | 12 +++++------ .../ui/components/DoubleButtonCombo.kt | 2 +- .../swisstransfer/ui/components/FileItem.kt | 2 +- .../ui/components/NewTransferFab.kt | 4 ++-- .../ui/components/SmallFileItem.kt | 2 +- .../ui/components/SwissTransferBottomSheet.kt | 8 ++++---- .../ui/components/SwissTransferFab.kt | 2 +- .../ui/components/transfer/TransferItem.kt | 8 ++++---- .../ui/images/icons/CircleBlackAndWhite.kt | 10 ---------- .../ui/images/icons/EyeCrossed.kt | 5 ----- .../ui/screen/main/sent/SentEmptyScreen.kt | 4 ++-- .../main/settings/components/SettingItem.kt | 2 +- .../components/SingleSelectOptions.kt | 6 +++--- .../transferdetails/TransferDetailsScreen.kt | 20 +++++++++---------- .../components/QrCodeBottomSheet.kt | 4 ++-- .../components/TransferInfo.kt | 3 ++- .../importfiles/ImportFilesScreen.kt | 4 ++-- .../components/ImportedFilesCard.kt | 2 +- .../components/TransferOptionType.kt | 6 +++--- .../components/TransferTypeButton.kt | 2 +- .../upload/UploadProgressViewModel.kt | 2 +- .../upload/UploadSuccessEmailScreen.kt | 2 +- .../upload/UploadSuccessQrScreen.kt | 4 ++-- .../newtransfer/upload/components/AdHeader.kt | 7 ++++--- .../newtransfer/upload/components/Progress.kt | 3 +++ .../upload/components/ShareAndCopyButtons.kt | 6 +++--- .../upload/components/WeightOneSpacer.kt | 8 ++++---- 32 files changed, 76 insertions(+), 110 deletions(-) diff --git a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Archive.kt b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Archive.kt index 2f87455d6..ebce899b5 100644 --- a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Archive.kt +++ b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Archive.kt @@ -34,12 +34,7 @@ internal val FileTypeIcons.Archive: ImageVector ).apply { path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero + pathFillType = NonZero, ) { moveTo(9.75f, 15.25f) arcToRelative(0.375f, 0.375f, 0.0f, false, true, 0.0f, -0.75f) @@ -101,12 +96,7 @@ internal val FileTypeIcons.Archive: ImageVector } path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero + pathFillType = NonZero, ) { moveTo(11.726f, 4.807f) arcToRelative(1.95f, 1.95f, 0.0f, false, true, -0.474f, 1.533f) diff --git a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Points.kt b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Points.kt index 9678be13b..d3597354e 100644 --- a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Points.kt +++ b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Points.kt @@ -55,12 +55,7 @@ internal val FileTypeIcons.Points: ImageVector } path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero + pathFillType = NonZero, ) { moveTo(13.0f, 5.007f) verticalLineToRelative(6.0f) @@ -69,12 +64,7 @@ internal val FileTypeIcons.Points: ImageVector } path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero + pathFillType = NonZero, ) { moveTo(11.0f, 7.007f) arcToRelative(6.0f, 6.0f, 0.0f, true, false, 6.0f, 6.0f) diff --git a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Video.kt b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Video.kt index ba5a8ef5e..5f057830a 100644 --- a/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Video.kt +++ b/FileTypes/src/main/java/com/infomaniak/library/filetypes/icons/Video.kt @@ -55,12 +55,7 @@ internal val FileTypeIcons.Video: ImageVector } path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero + pathFillType = NonZero, ) { moveTo(9.488f, 15.667f) arcTo(0.856f, 0.856f, 0.0f, false, true, 8.25f, 14.9f) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt index 6dc922ed2..2f0461e2e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.unit.dp import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons import com.infomaniak.swisstransfer.ui.images.icons.Camera +import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewLightAndDark @@ -53,12 +54,12 @@ fun BottomSheetItem(imageVector: ImageVector, @StringRes titleRes: Int, onClick: verticalAlignment = Alignment.CenterVertically, ) { Icon( - modifier = Modifier.size(Margin.Large), + modifier = Modifier.size(Dimens.IconSize), imageVector = imageVector, contentDescription = null, tint = SwissTransferTheme.materialColors.primary, ) - Spacer(modifier = Modifier.width(Margin.Large)) + Spacer(Modifier.width(Margin.Large)) Text( text = stringResource(id = titleRes), style = SwissTransferTheme.typography.bodyRegular, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt index 8fff507c0..ba3104522 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTopAppBar.kt @@ -46,11 +46,11 @@ fun BrandTopAppBar() { title = { Row(verticalAlignment = Alignment.CenterVertically) { Image(imageVector = AppIllus.LogoInfomaniak, contentDescription = null) - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) VerticalDivider(modifier = Modifier.height(Margin.Large), color = SwissTransferTheme.colors.toolbarTextColor) - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) Image(imageVector = AppIllus.LogoSwissTransfer, contentDescription = null) - Spacer(modifier = Modifier.width(Margin.Mini)) + Spacer(Modifier.width(Margin.Mini)) Text(text = stringResource(id = R.string.appName), color = SwissTransferTheme.colors.toolbarTextColor) } }, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt index 928137abf..fc82cf8eb 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt @@ -151,8 +151,8 @@ fun KeepButtonSize(imageVector: ImageVector?, titleRes: Int, content: @Composabl @Composable private fun ButtonTextContent(imageVector: ImageVector?, titleRes: Int) { imageVector?.let { - Icon(modifier = Modifier.size(Margin.Medium), imageVector = it, contentDescription = null) - Spacer(modifier = Modifier.width(Margin.Mini)) + Icon(modifier = Modifier.size(Dimens.SmallIconSize), imageVector = it, contentDescription = null) + Spacer(Modifier.width(Margin.Mini)) } Text(text = stringResource(id = titleRes), style = SwissTransferTheme.typography.bodyMedium) } @@ -208,7 +208,7 @@ private fun LargeButtonPreview() { ButtonType.entries.forEach { Row { LargeButton(titleRes = R.string.appName, style = it, onClick = {}, imageVector = AppIcons.Add) - Spacer(modifier = Modifier.width(Margin.Mini)) + Spacer(Modifier.width(Margin.Mini)) LargeButton( titleRes = R.string.appName, style = it, @@ -217,10 +217,10 @@ private fun LargeButtonPreview() { imageVector = AppIcons.Add ) - Spacer(modifier = Modifier.width(Margin.Mini)) + Spacer(Modifier.width(Margin.Mini)) SmallButton(titleRes = R.string.appName, style = it, imageVector = AppIcons.Add, onClick = {}) - Spacer(modifier = Modifier.width(Margin.Mini)) + Spacer(Modifier.width(Margin.Mini)) SmallButton( titleRes = R.string.appName, style = it, @@ -229,7 +229,7 @@ private fun LargeButtonPreview() { onClick = {} ) } - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) } } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/DoubleButtonCombo.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/DoubleButtonCombo.kt index 44941c1c5..ab7071426 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/DoubleButtonCombo.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/DoubleButtonCombo.kt @@ -66,7 +66,7 @@ private fun VerticallyStackedButtons( .padding(horizontal = Margin.Medium), ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) bottomButton( Modifier diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt index 8f44507bb..b910d238e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt @@ -145,7 +145,7 @@ private fun FileItemPreview(@PreviewParameter(FileUiListPreviewParameter::class) onRemove = {}, ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) val imageFile = files[1] FileItem( diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/NewTransferFab.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/NewTransferFab.kt index 04fe3246a..c380316c4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/NewTransferFab.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/NewTransferFab.kt @@ -74,9 +74,9 @@ private fun NewTransferFabPreview() { Surface { Row { NewTransferFab(newTransferFabType = NewTransferFabType.BOTTOM_BAR) - Spacer(modifier = Modifier.width(Margin.Large)) + Spacer(Modifier.width(Margin.Large)) NewTransferFab(newTransferFabType = NewTransferFabType.EMPTY_STATE) - Spacer(modifier = Modifier.width(Margin.Large)) + Spacer(Modifier.width(Margin.Large)) NewTransferFab(newTransferFabType = NewTransferFabType.NAVIGATION_RAIL) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallFileItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallFileItem.kt index 70890eed5..e941f7e9a 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallFileItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SmallFileItem.kt @@ -79,7 +79,7 @@ private fun SmallFileItemPreview(@PreviewParameter(FileUiListPreviewParameter::c onRemove = {} ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) SmallFileItem( file = file, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt index f597e31c3..6896bafe2 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt @@ -103,7 +103,7 @@ private fun BottomSheetContent( imageVector?.let { Image(modifier = paddedModifier, imageVector = imageVector, contentDescription = null) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } title?.let { @@ -114,7 +114,7 @@ private fun BottomSheetContent( color = SwissTransferTheme.colors.primaryTextColor, textAlign = TextAlign.Center, ) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } description?.let { @@ -125,12 +125,12 @@ private fun BottomSheetContent( color = SwissTransferTheme.colors.secondaryTextColor, textAlign = TextAlign.Center, ) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } content?.let { it() - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } DoubleButtonCombo(topButton = topButton, bottomButton = bottomButton) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt index d68746151..dde87a4c2 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt @@ -73,7 +73,7 @@ private fun SwissTransferFabPreview() { SwissTransferTheme { Row { SwissTransferFab(onClick = {}) - Spacer(modifier = Modifier.width(Margin.Large)) + Spacer(Modifier.width(Margin.Large)) SwissTransferFab(fabType = FabType.BIG, onClick = {}) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt index 7b081dd4c..308e5c981 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt @@ -87,14 +87,14 @@ fun TransferItem( overflow = TextOverflow.MiddleEllipsis, ) - Spacer(modifier = Modifier.height(Margin.Mini)) + Spacer(Modifier.height(Margin.Mini)) TextDotText( firstText = { uploadedSize }, secondText = { expiryText }, optionalSecondTextColor = expiryColor, ) - Spacer(modifier = Modifier.height(Margin.Mini)) + Spacer(Modifier.height(Margin.Mini)) ContextualFlowRow( itemCount = files.count(), maxLines = 1, @@ -105,11 +105,11 @@ fun TransferItem( } } - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) Icon( imageVector = AppIcons.ChevronRightThick, contentDescription = null, - modifier = Modifier.size(Margin.Medium), + modifier = Modifier.size(Dimens.SmallIconSize), tint = SwissTransferTheme.colors.iconColor, ) } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/CircleBlackAndWhite.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/CircleBlackAndWhite.kt index a2e0d3a56..4787d3ac3 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/CircleBlackAndWhite.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/CircleBlackAndWhite.kt @@ -51,11 +51,6 @@ val AppIcons.CircleBlackAndWhite: ImageVector ).apply { path( fill = SolidColor(Color(0xFF000000)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, pathFillType = NonZero, ) { moveTo(12.0f, 0.0f) @@ -75,11 +70,6 @@ val AppIcons.CircleBlackAndWhite: ImageVector }) { path( fill = SolidColor(Color(0xFFF5F5F5)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, pathFillType = NonZero, ) { moveTo(-4.5f, 27.5f) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/EyeCrossed.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/EyeCrossed.kt index 8ba8e4542..51ec20677 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/EyeCrossed.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/EyeCrossed.kt @@ -31,11 +31,6 @@ val AppIcons.EyeCrossed: ImageVector ).apply { path( fill = SolidColor(Color(0xFF9F9F9F)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, pathFillType = NonZero, ) { moveTo(14.715f, 1.154f) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt index c84446d2c..9290ebcd4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt @@ -51,14 +51,14 @@ fun SentEmptyScreen() { style = SwissTransferTheme.typography.specificMedium32, textAlign = TextAlign.Center, ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) Text( modifier = Modifier.widthIn(max = maxWidth), text = stringResource(id = R.string.firstTransferDescription), style = SwissTransferTheme.typography.bodyRegular, color = SwissTransferTheme.colors.secondaryTextColor, ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) ConstraintLayout { val (icon, fab) = createRefs() diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SettingItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SettingItem.kt index 4f651fb5a..59fe0c0ef 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SettingItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SettingItem.kt @@ -94,7 +94,7 @@ private fun SettingItemContent( } else { Image(imageVector = it, contentDescription = null) } - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) } Column(modifier = Modifier.weight(1.0f)) { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SingleSelectOptions.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SingleSelectOptions.kt index 9ca7e8ac3..10702c45e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SingleSelectOptions.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SingleSelectOptions.kt @@ -67,15 +67,15 @@ private fun SettingOptionItem(item: SettingOption, isSelected: Boolean, onClick: ) { item.icon?.let { Image(imageVector = it, contentDescription = null) - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) } ?: run { // Make sure the items with no icons have the same height as the ones with icons - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } Text(text = item.title(), Modifier.weight(1.0f), style = SwissTransferTheme.typography.bodyRegular) - if (isSelected) Spacer(modifier = Modifier.width(Margin.Medium)) + if (isSelected) Spacer(Modifier.width(Margin.Medium)) AnimatedVisibility( visible = isSelected, enter = scaleIn(), diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt index f9788ed62..fecf54c1f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt @@ -177,13 +177,13 @@ private fun ColumnScope.FilesList( setUidCheckStatus = { fileUid, isChecked -> setFileCheckStatus(fileUid, isChecked) }, header = { Column { - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) TransferInfo(transfer) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) if (shouldDisplayRecipients) TransferRecipients(transferRecipients) - if (shouldDisplayRecipients && shouldDisplayMessage) Spacer(modifier = Modifier.height(Margin.Mini)) + if (shouldDisplayRecipients && shouldDisplayMessage) Spacer(Modifier.height(Margin.Mini)) if (shouldDisplayMessage) TransferMessage(transfer.message!!) - if (shouldDisplayRecipients || shouldDisplayMessage) Spacer(modifier = Modifier.height(Margin.Large)) + if (shouldDisplayRecipients || shouldDisplayMessage) Spacer(Modifier.height(Margin.Large)) TransferContentHeader() } }, @@ -197,7 +197,7 @@ private fun TransferRecipients(recipients: List) { style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.secondaryTextColor, ) - Spacer(modifier = Modifier.height(Margin.Mini)) + Spacer(Modifier.height(Margin.Mini)) EmailsFlowRow(recipients) } @@ -208,7 +208,7 @@ private fun TransferMessage(transferMessage: String) { style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.secondaryTextColor, ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) SwissTransferCard { Text( text = transferMessage, @@ -246,14 +246,14 @@ private fun BottomBar(direction: TransferDirection, isMultiselectOn: () -> Boole when (direction) { TransferDirection.SENT -> { - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) BottomBarButton(BottomBarItem.QR_CODE, onClick) - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) BottomBarButton(BottomBarItem.PASSWORD, onClick) } TransferDirection.RECEIVED -> { - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) BottomBarButton(BottomBarItem.DOWNLOAD, onClick) } } @@ -275,7 +275,7 @@ private fun RowScope.BottomBarButton(item: BottomBarItem, onClick: (BottomBarIte horizontalAlignment = Alignment.CenterHorizontally, ) { Icon(item.icon, null) - Spacer(modifier = Modifier.height(Margin.Micro)) + Spacer(Modifier.height(Margin.Micro)) Text(stringResource(item.label)) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/QrCodeBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/QrCodeBottomSheet.kt index 389c6771c..f6e62c66f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/QrCodeBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/QrCodeBottomSheet.kt @@ -49,9 +49,9 @@ fun QrCodeBottomSheet(isVisible: () -> Boolean, transferUrl: String, closeBottom descriptionRes = R.string.shareQrCodeDescription, ) { Column { - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) QrCode(transferUrl) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/TransferInfo.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/TransferInfo.kt index 838002d61..2ed11bca1 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/TransferInfo.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/TransferInfo.kt @@ -42,6 +42,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.ArrowDownFile import com.infomaniak.swisstransfer.ui.images.icons.Clock import com.infomaniak.swisstransfer.ui.images.icons.FileZip import com.infomaniak.swisstransfer.ui.previewparameter.TransferUiListPreviewParameter +import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewLightAndDark @@ -85,7 +86,7 @@ fun TransferInfo(transfer: TransferUi) { private fun IconText(icon: ImageVector, text: String) { Row(verticalAlignment = Alignment.CenterVertically) { Icon( - modifier = Modifier.size(Margin.Medium), + modifier = Modifier.size(Dimens.SmallIconSize), imageVector = icon, tint = SwissTransferTheme.materialColors.primary, contentDescription = null, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt index c003f8e7e..47312a348 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt @@ -239,12 +239,12 @@ private fun ColumnScope.EmailAddressesTextFields(selectedTransferType: () -> Tra modifier = Modifier.fillMaxWidth(), label = stringResource(R.string.transferSenderAddressPlaceholder), ) - Spacer(Modifier.size(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) SwissTransferTextField( modifier = Modifier.fillMaxWidth(), label = stringResource(R.string.transferRecipientAddressPlaceholder), ) - Spacer(Modifier.size(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) } } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/ImportedFilesCard.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/ImportedFilesCard.kt index 94a55e3da..20ed5c489 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/ImportedFilesCard.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/ImportedFilesCard.kt @@ -61,7 +61,7 @@ fun ImportedFilesCard( secondText = { formatSpaceLeft(humanReadableSize) }, modifier = Modifier.padding(start = Margin.Medium), ) - Spacer(modifier = Modifier.weight(1f)) + Spacer(Modifier.weight(1.0f)) Icon( imageVector = AppIcons.ChevronRightThick, contentDescription = null, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferOptionType.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferOptionType.kt index cd4bb12a6..a4b84433c 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferOptionType.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferOptionType.kt @@ -50,15 +50,15 @@ fun TransferOptionType( tint = SwissTransferTheme.materialColors.primary, contentDescription = null, ) - Spacer(modifier = Modifier.width(Margin.Small)) + Spacer(Modifier.width(Margin.Small)) Text( text = stringResource(transferOptionType.buttonText), color = SwissTransferTheme.materialColors.primary, style = SwissTransferTheme.typography.bodySmallMedium, ) - Spacer(modifier = Modifier.weight(1.0f)) + Spacer(Modifier.weight(1.0f)) SettingValue(selectedSetting) - Spacer(modifier = Modifier.width(Margin.Small)) + Spacer(Modifier.width(Margin.Small)) Icon( modifier = Modifier.size(Dimens.SmallIconSize), imageVector = AppIcons.ChevronRightThick, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt index a99933d5d..630d1beaf 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt @@ -52,7 +52,7 @@ fun TransferTypeButton( contentPadding = PaddingValues(Margin.Medium), ) { Icon(modifier = Modifier.size(Dimens.IconSize), imageVector = transferType.buttonIcon, contentDescription = null) - Spacer(modifier = Modifier.width(Margin.Mini)) + Spacer(Modifier.width(Margin.Mini)) Text(text = stringResource(transferType.buttonTextRes), style = SwissTransferTheme.typography.bodySmallRegular) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressViewModel.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressViewModel.kt index ca126f22a..a49aee859 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressViewModel.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressViewModel.kt @@ -48,7 +48,7 @@ class UploadProgressViewModel @Inject constructor( }.stateIn( scope = viewModelScope, started = SharingStarted.Eagerly, - initialValue = UploadWorker.UploadProgressUiState.Default + initialValue = UploadWorker.UploadProgressUiState.Default, ) fun trackUploadProgress() { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt index 2b0050e23..91df59f80 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt @@ -66,7 +66,7 @@ fun UploadSuccessEmailScreen( description = pluralStringResource(TransferTypeUi.MAIL.descriptionRes!!, emails.count()), ) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) EmailsFlowRow( emails = emails, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessQrScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessQrScreen.kt index 927295f82..a5dcbf8c1 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessQrScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessQrScreen.kt @@ -74,13 +74,13 @@ private fun ColumnScope.SuccessMessage(transferType: TransferTypeUi, transferUrl Column( modifier = Modifier .fillMaxWidth() - .weight(1f) + .weight(1.0f) .verticalScroll(rememberScrollState()) .padding(horizontal = Margin.Medium), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) Image(imageVector = AppIllus.Beers.image(), contentDescription = null) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/AdHeader.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/AdHeader.kt index 11cf43cdb..1b89a0875 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/AdHeader.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/AdHeader.kt @@ -40,11 +40,11 @@ fun ColumnScope.AdHeader(adScreenType: UploadProgressAdType) { Column( modifier = Modifier .fillMaxWidth() - .weight(1f) + .weight(1.0f) .verticalScroll(rememberScrollState()), horizontalAlignment = Alignment.CenterHorizontally, ) { - Spacer(modifier = Modifier.height(Margin.Giant)) + Spacer(Modifier.height(Margin.Giant)) HighlightedText( templateRes = R.string.uploadProgressTitleTemplate, @@ -52,7 +52,8 @@ fun ColumnScope.AdHeader(adScreenType: UploadProgressAdType) { style = SwissTransferTheme.typography.bodyMedium, ) - Spacer(modifier = Modifier.height(Margin.Huge)) + Spacer(Modifier.height(Margin.Huge)) + Text( text = adScreenType.description(), modifier = Modifier.widthIn(max = Dimens.DescriptionWidth), diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/Progress.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/Progress.kt index 2a403fbcf..7da176a48 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/Progress.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/Progress.kt @@ -41,6 +41,7 @@ fun Progress( TotalSize(totalSizeInBytes) } } + @Composable private fun Percentage(uploadedSizeInBytes: () -> Long, totalSizeInBytes: Long) { val percentageNoDecimals by remember { @@ -52,6 +53,7 @@ private fun Percentage(uploadedSizeInBytes: () -> Long, totalSizeInBytes: Long) Text("$percentageNoDecimals%") } + @Composable private fun UploadedSize(uploadedSizeInBytes: () -> Long) { val context = LocalContext.current @@ -61,6 +63,7 @@ private fun UploadedSize(uploadedSizeInBytes: () -> Long) { Text(humanReadableSize) } + @Composable private fun TotalSize(totalSizeInBytes: Long) { val context = LocalContext.current diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/ShareAndCopyButtons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/ShareAndCopyButtons.kt index 46436d2bd..1e85ba62f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/ShareAndCopyButtons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/ShareAndCopyButtons.kt @@ -60,7 +60,7 @@ fun ColumnScope.ShareAndCopyButtons(modifier: Modifier = Modifier, transferLink: onClick = { context.shareText(transferLink) }, ) - Spacer(modifier = Modifier.width(Margin.Medium)) + Spacer(Modifier.width(Margin.Medium)) ShareCopyButton( textRes = R.string.buttonCopyLink, @@ -78,7 +78,7 @@ fun ColumnScope.ShareAndCopyButtons(modifier: Modifier = Modifier, transferLink: @Composable private fun RowScope.ShareCopyButton(icon: ImageVector, @StringRes textRes: Int, onClick: () -> Unit) { Button( - modifier = Modifier.weight(1f), + modifier = Modifier.weight(1.0f), shape = CustomShapes.MEDIUM, colors = ButtonType.SECONDARY.buttonColors(), contentPadding = PaddingValues(vertical = Margin.Medium), @@ -89,7 +89,7 @@ private fun RowScope.ShareCopyButton(icon: ImageVector, @StringRes textRes: Int, verticalArrangement = Arrangement.Center, ) { Icon(icon, contentDescription = null, modifier = Modifier.size(Dimens.SmallIconSize)) - Spacer(modifier = Modifier.height(Margin.Micro)) + Spacer(Modifier.height(Margin.Micro)) Text(stringResource(textRes)) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/WeightOneSpacer.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/WeightOneSpacer.kt index b61046b71..48ee1a69c 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/WeightOneSpacer.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/WeightOneSpacer.kt @@ -24,12 +24,12 @@ import androidx.compose.ui.unit.Dp @Composable fun ColumnScope.WeightOneSpacer(minHeight: Dp) { - Spacer(modifier = Modifier.height(minHeight)) - Spacer(modifier = Modifier.weight(1f)) + Spacer(Modifier.height(minHeight)) + Spacer(Modifier.weight(1.0f)) } @Composable fun RowScope.WeightOneSpacer(minWidth: Dp) { - Spacer(modifier = Modifier.width(minWidth)) - Spacer(modifier = Modifier.weight(1f)) + Spacer(Modifier.width(minWidth)) + Spacer(Modifier.weight(1.0f)) }