From de9cae0728016cffc56237c11b8f94d27a435592 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 18 Nov 2024 18:25:14 +0100 Subject: [PATCH] chore: Sort `Text()` parameters order --- .../ui/components/EmailAddressChip.kt | 2 +- .../swisstransfer/ui/components/FilePreview.kt | 6 +++--- .../swisstransfer/ui/components/HighlightedText.kt | 2 +- .../ui/components/SwissTransferBottomSheet.kt | 8 ++++---- .../ui/components/SwissTransferTextField.kt | 2 +- .../ui/components/SwissTransferTopAppBar.kt | 2 +- .../swisstransfer/ui/components/TextDotText.kt | 14 +++++--------- .../ui/components/transfer/TransferFilePreview.kt | 2 +- .../ui/components/transfer/TransferItemList.kt | 2 +- .../main/components/AppNavigationSuiteScaffold.kt | 2 +- .../ui/screen/main/sent/SentEmptyScreen.kt | 6 +++--- .../ui/screen/main/settings/SettingsScreen.kt | 2 +- .../settings/components/SingleSelectOptions.kt | 6 +++++- .../ui/screen/main/settings/components/Titles.kt | 2 +- .../main/transferdetails/TransferDetailsScreen.kt | 4 ++-- .../transferdetails/components/TransferInfo.kt | 2 +- .../main/transfers/TransfersScreenWrapper.kt | 2 +- .../newtransfer/importfiles/ImportFilesScreen.kt | 4 ++-- .../importfiles/ValidateUserEmailScreen.kt | 2 +- .../importfiles/components/TransferOptionType.kt | 2 +- .../newtransfer/upload/UploadSuccessQrScreen.kt | 2 +- .../newtransfer/upload/components/AdHeader.kt | 4 ++-- .../upload/components/ShareAndCopyButtons.kt | 2 +- 23 files changed, 41 insertions(+), 41 deletions(-) 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/FilePreview.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FilePreview.kt index ab50058a6..606e9c621 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FilePreview.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FilePreview.kt @@ -110,12 +110,12 @@ private fun FileIcon( if (showFileName) { Text( - fileName, - modifier = Modifier.align(Alignment.BottomCenter), + text = fileName, style = SwissTransferTheme.typography.labelRegular, color = SwissTransferTheme.colors.secondaryTextColor, - overflow = TextOverflow.Ellipsis, maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.align(Alignment.BottomCenter), ) } } 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 a3338a546..a1287b96b 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 @@ -207,7 +207,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/SwissTransferBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt index 6896bafe2..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 @@ -108,22 +108,22 @@ private fun BottomSheetContent( 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.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.height(Margin.Large)) } 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/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/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 9290ebcd4..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,17 +46,17 @@ 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.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.height(Margin.Medium)) ConstraintLayout { 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/SingleSelectOptions.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/SingleSelectOptions.kt index 10702c45e..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 @@ -73,7 +73,11 @@ private fun SettingOptionItem(item: SettingOption, isSelected: Boolean, onClick: 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.width(Margin.Medium)) AnimatedVisibility( 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 62c3fad3b..c84929578 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 @@ -213,9 +213,9 @@ private fun TransferMessage(transferMessage: String) { SwissTransferCard { Text( text = transferMessage, - modifier = Modifier.padding(all = Margin.Large), style = SwissTransferTheme.typography.bodySmallRegular, color = SwissTransferTheme.colors.primaryTextColor, + modifier = Modifier.padding(all = Margin.Large), ) } } @@ -277,7 +277,7 @@ private fun RowScope.BottomBarButton(item: BottomBarItem, onClick: (BottomBarIte ) { Icon(item.icon, null) Spacer(Modifier.height(Margin.Micro)) - Text(stringResource(item.label)) + Text(text = stringResource(item.label)) } } } 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 261d72fe1..44a80b6d7 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 @@ -95,10 +95,10 @@ private fun IconText(icon: ImageVector, text: String) { 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 d3ed28f69..b5a8eb95c 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 @@ -318,9 +318,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/TransferOptionType.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferOptionType.kt index a4b84433c..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 @@ -53,8 +53,8 @@ fun TransferOptionType( Spacer(Modifier.width(Margin.Small)) Text( text = stringResource(transferOptionType.buttonText), - color = SwissTransferTheme.materialColors.primary, style = SwissTransferTheme.typography.bodySmallMedium, + color = SwissTransferTheme.materialColors.primary, ) Spacer(Modifier.weight(1.0f)) SettingValue(selectedSetting) 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 a5dcbf8c1..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 @@ -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 1b89a0875..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 @@ -56,9 +56,9 @@ fun ColumnScope.AdHeader(adScreenType: UploadProgressAdType) { 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/ShareAndCopyButtons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/ShareAndCopyButtons.kt index 1e85ba62f..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 @@ -90,7 +90,7 @@ private fun RowScope.ShareCopyButton(icon: ImageVector, @StringRes textRes: Int, ) { Icon(icon, contentDescription = null, modifier = Modifier.size(Dimens.SmallIconSize)) Spacer(Modifier.height(Margin.Micro)) - Text(stringResource(textRes)) + Text(text = stringResource(textRes)) } } }