From c9abc0904910b58152efca411142d07433d684c7 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 +- .../ui/components/EmailAddressChip.kt | 2 +- .../swisstransfer/ui/components/FileItem.kt | 2 +- .../ui/components/HighlightedText.kt | 2 +- .../ui/components/NewTransferFab.kt | 4 ++-- .../ui/components/SmallFileItem.kt | 2 +- .../ui/components/SwissTransferBottomSheet.kt | 16 ++++++------- .../ui/components/SwissTransferFab.kt | 2 +- .../ui/components/SwissTransferTextField.kt | 2 +- .../ui/components/SwissTransferTopAppBar.kt | 2 +- .../ui/components/TextDotText.kt | 14 ++++------- .../transfer/TransferFilePreview.kt | 2 +- .../ui/components/transfer/TransferItem.kt | 8 +++---- .../components/transfer/TransferItemList.kt | 2 +- .../ui/images/icons/CircleBlackAndWhite.kt | 10 -------- .../ui/images/icons/EyeCrossed.kt | 5 ---- .../components/AppNavigationSuiteScaffold.kt | 2 +- .../ui/screen/main/sent/SentEmptyScreen.kt | 10 ++++---- .../ui/screen/main/settings/SettingsScreen.kt | 2 +- .../main/settings/components/SettingItem.kt | 2 +- .../components/SingleSelectOptions.kt | 12 ++++++---- .../screen/main/settings/components/Titles.kt | 2 +- .../transferdetails/TransferDetailsScreen.kt | 24 +++++++++---------- .../components/QrCodeBottomSheet.kt | 4 ++-- .../components/TransferInfo.kt | 5 ++-- .../main/transfers/TransfersScreenWrapper.kt | 2 +- .../importfiles/ImportFilesScreen.kt | 8 +++---- .../importfiles/ValidateUserEmailScreen.kt | 2 +- .../components/ImportedFilesCard.kt | 2 +- .../components/TransferOptionType.kt | 8 +++---- .../components/TransferTypeButton.kt | 2 +- .../components/TransferTypeButtons.kt | 2 +- .../upload/UploadProgressScreen.kt | 4 ++-- .../upload/UploadProgressViewModel.kt | 2 +- .../upload/UploadSuccessEmailScreen.kt | 2 +- .../upload/UploadSuccessQrScreen.kt | 6 ++--- .../newtransfer/upload/components/AdHeader.kt | 11 +++++---- .../newtransfer/upload/components/Progress.kt | 3 +++ .../upload/components/ShareAndCopyButtons.kt | 8 +++---- .../upload/components/WeightOneSpacer.kt | 8 +++---- 46 files changed, 117 insertions(+), 151 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/EmailAddressChip.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmailAddressChip.kt index e2334b4a0..18d757b9b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmailAddressChip.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmailAddressChip.kt @@ -39,9 +39,9 @@ fun EmailAddressChip( label = { Text( text = text, + style = SwissTransferTheme.typography.bodyRegular, maxLines = 1, overflow = TextOverflow.MiddleEllipsis, - style = SwissTransferTheme.typography.bodyRegular, ) }, modifier = 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/HighlightedText.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/HighlightedText.kt index e8138c6ca..c0667840d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/HighlightedText.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/HighlightedText.kt @@ -178,7 +178,7 @@ private fun Preview() { HighlightedText( templateRes = R.string.uploadProgressTitleTemplate, argumentRes = R.string.uploadProgressTitleArgument, - style = SwissTransferTheme.typography.bodyMedium + style = SwissTransferTheme.typography.bodyMedium, ) } } 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..6c1e6caf3 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,34 +103,34 @@ 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 { Text( - modifier = paddedModifier, text = it, + textAlign = TextAlign.Center, style = SwissTransferTheme.typography.bodyMedium, color = SwissTransferTheme.colors.primaryTextColor, - textAlign = TextAlign.Center, + modifier = paddedModifier, ) - Spacer(modifier = Modifier.height(Margin.Large)) + Spacer(Modifier.height(Margin.Large)) } description?.let { Text( - modifier = paddedModifier, text = it, + textAlign = TextAlign.Center, style = SwissTransferTheme.typography.bodyRegular, color = SwissTransferTheme.colors.secondaryTextColor, - textAlign = TextAlign.Center, + modifier = paddedModifier, ) - 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/SwissTransferTextField.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTextField.kt index 9dc1e8f3a..b79628195 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTextField.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTextField.kt @@ -96,7 +96,7 @@ fun SwissTransferTextField( readOnly = isReadOnly, enabled = !isReadOnly, value = text, - label = displayLabel?.let { { Text(text = it) } }, + label = displayLabel?.let { { Text(it) } }, minLines = minLineNumber, maxLines = maxLineNumber, colors = textFieldColors, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt index 83dd38a94..567ef6d38 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt @@ -55,7 +55,7 @@ fun SwissTransferTopAppBar( actionIconContentColor = SwissTransferTheme.colors.toolbarIconColor, navigationIconContentColor = SwissTransferTheme.colors.toolbarIconColor, ), - title = { Text(title, style = SwissTransferTheme.typography.h2) }, + title = { Text(text = title, style = SwissTransferTheme.typography.h2) }, navigationIcon = { navigationMenu?.let { MenuButton(navigationMenu) } }, actions = { actionMenus.forEach { actionMenu -> MenuButton(actionMenu) } }, ) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt index 2988e9256..0aa492c9f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt @@ -38,19 +38,15 @@ fun TextDotText( optionalSecondTextColor: Color? = null, ) { Row(modifier) { - CustomText(firstText, color, style) + CustomText(text = firstText, style = style, color = color) Spacer(Modifier.width(Margin.Mini)) - Text( - text = "•", - color = color, - style = style, - ) + Text(text = "•", style = style, color = color) Spacer(Modifier.width(Margin.Mini)) - CustomText(secondText, optionalSecondTextColor ?: color, style) + CustomText(text = secondText, style = style, color = optionalSecondTextColor ?: color) } } @Composable -private fun CustomText(value: @Composable () -> String, color: Color, style: TextStyle) { - Text(text = value(), color = color, style = style) +private fun CustomText(text: @Composable () -> String, style: TextStyle, color: Color) { + Text(text = text(), style = style, color = color) } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferFilePreview.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferFilePreview.kt index fbeedb957..ed3e6e5c3 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferFilePreview.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferFilePreview.kt @@ -50,8 +50,8 @@ fun TransferFilePreview(file: FileUi? = null, remainingFilesCount: Int? = null) ) { Text( text = "+$remainingFilesCount", - color = SwissTransferTheme.colors.onTransferFilePreviewOverflow, style = SwissTransferTheme.typography.bodyRegular, + color = SwissTransferTheme.colors.onTransferFilePreviewOverflow, ) } } else { 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/components/transfer/TransferItemList.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItemList.kt index 7401d5a99..d16879a50 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItemList.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItemList.kt @@ -55,7 +55,7 @@ fun TransferItemList( contentPadding = PaddingValues(top = Margin.Mini), ) { - item { Text(stringResource(titleRes), style = SwissTransferTheme.typography.h1) } + item { Text(text = stringResource(titleRes), style = SwissTransferTheme.typography.h1) } items( count = getTransfers().count(), 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/components/AppNavigationSuiteScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt index 1fcdcb220..b933e8cae 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt @@ -144,5 +144,5 @@ private fun NavigationIcon(isNavigationBar: Boolean, navigationItem: NavigationI @Composable private fun NavigationLabel(navigationItem: NavigationItem) { - Text(stringResource(navigationItem.label)) + Text(text = stringResource(navigationItem.label)) } 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..bc888654f 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 @@ -46,19 +46,19 @@ fun SentEmptyScreen() { ) { val maxWidth = Dimens.DescriptionWidth Text( - modifier = Modifier.widthIn(max = maxWidth), text = stringResource(id = R.string.sentEmptyTitle), - style = SwissTransferTheme.typography.specificMedium32, textAlign = TextAlign.Center, + style = SwissTransferTheme.typography.specificMedium32, + modifier = Modifier.widthIn(max = maxWidth), ) - 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, + modifier = Modifier.widthIn(max = maxWidth), ) - 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/SettingsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt index 4145c33f0..37e9672ec 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt @@ -67,9 +67,9 @@ fun SettingsScreen( .selectableGroup(), ) { Text( - modifier = Modifier.padding(horizontal = Margin.Medium, vertical = Margin.Large), text = stringResource(R.string.settingsTitle), style = SwissTransferTheme.typography.h1, + modifier = Modifier.padding(horizontal = Margin.Medium, vertical = Margin.Large), ) SettingTitle(R.string.settingsCategoryGeneral) 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..e0cf917e1 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,19 @@ 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) + Text( + text = item.title(), + style = SwissTransferTheme.typography.bodyRegular, + modifier = Modifier.weight(1.0f), + ) - 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/settings/components/Titles.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/Titles.kt index c78efbb2f..b784a692d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/Titles.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/Titles.kt @@ -50,10 +50,10 @@ fun OptionTitle(@StringRes titleRes: Int) { @Composable private fun UnpaddedTitle(modifier: Modifier, titleRes: Int) { Text( - modifier = modifier, text = stringResource(id = titleRes), style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.secondaryTextColor, + modifier = modifier, ) } 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..17398a9f3 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,13 +208,13 @@ 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, - modifier = Modifier.padding(all = Margin.Large), style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.primaryTextColor, + modifier = Modifier.padding(all = Margin.Large), ) } } @@ -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,8 +275,8 @@ private fun RowScope.BottomBarButton(item: BottomBarItem, onClick: (BottomBarIte horizontalAlignment = Alignment.CenterHorizontally, ) { Icon(item.icon, null) - Spacer(modifier = Modifier.height(Margin.Micro)) - Text(stringResource(item.label)) + Spacer(Modifier.height(Margin.Micro)) + Text(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..80e2de92d 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,16 +86,16 @@ 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, ) Text( - modifier = Modifier.padding(start = Margin.Mini), text = text, style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.primaryTextColor, + modifier = Modifier.padding(start = Margin.Mini), ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt index 51675b03e..3e469ab40 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt @@ -97,7 +97,7 @@ private fun DetailPane(navigator: ThreePaneScaffoldNavigator @Composable private fun NoSelectionEmptyState() { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { - Text("Select an item", color = SwissTransferTheme.colors.secondaryTextColor) + Text(text = "Select an item", color = SwissTransferTheme.colors.secondaryTextColor) } } 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..5bc08a7d5 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)) } } } @@ -317,9 +317,9 @@ private fun SendButton( @Composable private fun ImportFilesTitle(modifier: Modifier = Modifier, @StringRes titleRes: Int) { Text( - modifier = modifier, - style = SwissTransferTheme.typography.bodySmallRegular, text = stringResource(titleRes), + style = SwissTransferTheme.typography.bodySmallRegular, + modifier = modifier, ) } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt index 8afa4e9e7..e76e13955 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt @@ -22,5 +22,5 @@ import androidx.compose.runtime.Composable @Composable fun ValidateUserEmailScreen() { - Text("ValidateUserEmailScreen") + Text(text = "ValidateUserEmailScreen") } 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..91475b991 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, + color = SwissTransferTheme.materialColors.primary, ) - 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/importfiles/components/TransferTypeButtons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt index 0a1c27e3d..e32851f3a 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt @@ -92,7 +92,7 @@ enum class TransferTypeUi( ); companion object { - fun TransferType.toTransferTypeUi() = when(this) { + fun TransferType.toTransferTypeUi() = when (this) { TransferType.LINK -> LINK TransferType.QR_CODE -> QR_CODE TransferType.PROXIMITY -> PROXIMITY diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt index 5010db7eb..2e969cfe1 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt @@ -114,10 +114,10 @@ private fun UploadProgressScreen( ) { AdHeader(adScreenType) - Spacer(modifier = Modifier.height(Margin.Medium)) + Spacer(Modifier.height(Margin.Medium)) Text(stringResource(R.string.uploadProgressIndication)) Progress(progressState, totalSizeInBytes) - Spacer(modifier = Modifier.height(Margin.Huge)) + Spacer(Modifier.height(Margin.Huge)) } if (showBottomSheet.get()) CancelUploadBottomSheet(onCancel = onCancel, closeButtonSheet = { showBottomSheet.set(false) }) 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..f71a238b8 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) @@ -100,8 +100,8 @@ private fun ColumnScope.SuccessMessage(transferType: TransferTypeUi, transferUrl Spacer(Modifier.height(Margin.Huge)) Text( text = stringResource(descriptionRes), - style = SwissTransferTheme.typography.bodyRegular, textAlign = TextAlign.Center, + style = SwissTransferTheme.typography.bodyRegular, color = SwissTransferTheme.colors.secondaryTextColor, modifier = Modifier.widthIn(max = Dimens.DescriptionWidth), ) 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..9e4bdd397 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,12 +52,13 @@ 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), - style = SwissTransferTheme.typography.specificLight18, textAlign = TextAlign.Center, + style = SwissTransferTheme.typography.specificLight18, + modifier = Modifier.widthIn(max = Dimens.DescriptionWidth), ) WeightOneSpacer(minHeight = Margin.Medium) 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..848dd8bf4 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,8 +89,8 @@ 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)) - Text(stringResource(textRes)) + Spacer(Modifier.height(Margin.Micro)) + Text(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)) }