Skip to content

Commit

Permalink
chore: Sort Text() parameters order
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Nov 19, 2024
1 parent 017723f commit b0f6a87
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private fun Preview() {
HighlightedText(
templateRes = R.string.uploadProgressTitleTemplate,
argumentRes = R.string.uploadProgressTitleArgument,
style = SwissTransferTheme.typography.bodyMedium
style = SwissTransferTheme.typography.bodyMedium,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) } },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,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),
)
}
}
Expand Down Expand Up @@ -276,7 +276,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))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,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),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private fun DetailPane(navigator: ThreePaneScaffoldNavigator<DestinationContent>
@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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ import androidx.compose.runtime.Composable

@Composable
fun ValidateUserEmailScreen() {
Text("ValidateUserEmailScreen")
Text(text = "ValidateUserEmailScreen")
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down

0 comments on commit b0f6a87

Please sign in to comment.