From fb517bd96344b128127be85457c0ecba4a9161d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 4 Oct 2023 13:46:10 +0200 Subject: [PATCH] Revert "Rename global property `Dimens` to `dimens`" This reverts commit c920a989f3ba2373461f9ab0cf09fd6a7b29a01a. --- .../components/RadioButtonDialogComponent.kt | 4 ++-- .../commons/compose/menus/ActionMenu.kt | 6 ++--- .../compose/screens/ContributorsScreen.kt | 10 ++++----- .../commons/compose/screens/FAQScreen.kt | 8 +++---- .../commons/compose/screens/LicenseScreen.kt | 6 ++--- .../screens/ManageBlockedNumbersScreen.kt | 22 +++++++++---------- .../settings/SettingsCheckBoxComponent.kt | 6 ++--- .../commons/compose/settings/SettingsGroup.kt | 4 ++-- .../compose/settings/SettingsListItem.kt | 10 ++++----- .../settings/SettingsTitleTextComponent.kt | 6 ++--- .../scaffold/SettingsScaffoldTopBar.kt | 10 ++++----- .../commons/compose/theme/Dimensions.kt | 2 +- 12 files changed, 47 insertions(+), 47 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/components/RadioButtonDialogComponent.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/components/RadioButtonDialogComponent.kt index 04160233c..a81d28836 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/components/RadioButtonDialogComponent.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/components/RadioButtonDialogComponent.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.extensions.rememberMutableInteractionSource import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.dialogs.dialogTextColor @Composable @@ -47,7 +47,7 @@ fun RadioButtonDialogComponent( ) Text( text = item, - modifier = Modifier.padding(start = dimens.margin.medium), + modifier = Modifier.padding(start = Dimens.margin.medium), color = dialogTextColor ) } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/menus/ActionMenu.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/menus/ActionMenu.kt index 949259f09..f6d84f6c6 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/menus/ActionMenu.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/menus/ActionMenu.kt @@ -28,7 +28,7 @@ import com.simplemobiletools.commons.compose.components.SimpleDropDownMenuItem import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.extensions.rememberMutableInteractionSource import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.compose.theme.Shapes import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList @@ -96,7 +96,7 @@ fun ActionMenu( Text( text = name, fontSize = 14.sp, - modifier = Modifier.padding(dimens.margin.medium), + modifier = Modifier.padding(Dimens.margin.medium), ) } }, @@ -125,7 +125,7 @@ fun ActionMenu( Text( text = stringResource(id = R.string.more_options), fontSize = 14.sp, - modifier = Modifier.padding(dimens.margin.medium), + modifier = Modifier.padding(Dimens.margin.medium), ) } }, diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ContributorsScreen.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ContributorsScreen.kt index d3d862307..18d419fb7 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ContributorsScreen.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ContributorsScreen.kt @@ -24,7 +24,7 @@ import com.simplemobiletools.commons.compose.settings.SettingsListItem import com.simplemobiletools.commons.compose.settings.SettingsTitleTextComponent import com.simplemobiletools.commons.compose.settings.scaffold.SettingsLazyScaffold import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.models.LanguageContributor import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList @@ -65,7 +65,7 @@ internal fun ContributorsScreen( ) } item { - Spacer(modifier = Modifier.padding(vertical = dimens.margin.medium)) + Spacer(modifier = Modifier.padding(vertical = Dimens.margin.medium)) } item { SettingsHorizontalDivider() @@ -94,7 +94,7 @@ internal fun ContributorsScreen( ) } item { - Spacer(modifier = Modifier.padding(bottom = dimens.margin.medium)) + Spacer(modifier = Modifier.padding(bottom = Dimens.margin.medium)) } } @@ -117,8 +117,8 @@ private fun ContributorItem( }, leadingContent = { val imageSize = Modifier - .size(dimens.icon.medium) - .padding(dimens.margin.medium) + .size(Dimens.icon.medium) + .padding(Dimens.margin.medium) Image( modifier = imageSize, painter = painterResource(id = languageContributor.iconId), diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/FAQScreen.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/FAQScreen.kt index 03dbd1695..c056c4fc7 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/FAQScreen.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/FAQScreen.kt @@ -25,7 +25,7 @@ import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.settings.SettingsHorizontalDivider import com.simplemobiletools.commons.compose.settings.scaffold.SettingsLazyScaffold import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.extensions.removeUnderlines import com.simplemobiletools.commons.models.FAQItem import kotlinx.collections.immutable.ImmutableList @@ -39,7 +39,7 @@ internal fun FAQScreen( SettingsLazyScaffold( title = stringResource(id = R.string.frequently_asked_questions), goBack = goBack, - contentPadding = PaddingValues(bottom = dimens.margin.medium) + contentPadding = PaddingValues(bottom = Dimens.margin.medium) ) { itemsIndexed(faqItems) { index, faqItem -> Column(modifier = Modifier.fillMaxWidth()) { @@ -72,12 +72,12 @@ internal fun FAQScreen( } }, ) - Spacer(modifier = Modifier.padding(bottom = dimens.margin.medium)) + Spacer(modifier = Modifier.padding(bottom = Dimens.margin.medium)) if (index != faqItems.lastIndex) { SettingsHorizontalDivider( modifier = Modifier .fillMaxWidth() - .padding(bottom = dimens.margin.small) + .padding(bottom = Dimens.margin.small) ) } } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/LicenseScreen.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/LicenseScreen.kt index 89ac649f4..ae0dedd25 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/LicenseScreen.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/LicenseScreen.kt @@ -16,7 +16,7 @@ import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.settings.SettingsHorizontalDivider import com.simplemobiletools.commons.compose.settings.scaffold.SettingsLazyScaffold import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.models.License import kotlinx.collections.immutable.ImmutableList @@ -36,7 +36,7 @@ internal fun LicenseScreen( Column { LicenseItem(license, onLicenseClick) if (index != thirdPartyLicenses.lastIndex) { - SettingsHorizontalDivider(modifier = Modifier.padding(bottom = dimens.margin.small)) + SettingsHorizontalDivider(modifier = Modifier.padding(bottom = Dimens.margin.small)) } } } @@ -59,7 +59,7 @@ private fun LicenseItem( }, supportingContent = { Text( text = stringResource(id = license.textId), - modifier = Modifier.padding(top = dimens.margin.extraSmall), + modifier = Modifier.padding(top = Dimens.margin.extraSmall), ) }, colors = ListItemDefaults.colors(headlineColor = MaterialTheme.colorScheme.primary, supportingColor = MaterialTheme.colorScheme.onSurface)) } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt index e8b11eba5..d3e507401 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt @@ -84,7 +84,7 @@ internal fun ManageBlockedNumbersScreen( onEdit: (BlockedNumber) -> Unit, onCopy: (BlockedNumber) -> Unit, ) { - val dimens = dimens + val dimens = Dimens val startingPadding = remember { Modifier.padding(horizontal = dimens.margin.small) } val selectedIds: MutableState> = rememberSaveable { mutableStateOf(emptySet()) } val hapticFeedback = LocalHapticFeedback.current @@ -193,7 +193,7 @@ internal fun ManageBlockedNumbersScreen( ids = blockedNumbers?.map { blockedNumber -> blockedNumber.id }.orEmpty() ) }, - verticalArrangement = Arrangement.spacedBy(com.simplemobiletools.commons.compose.theme.dimens.margin.extraSmall), + verticalArrangement = Arrangement.spacedBy(Dimens.margin.extraSmall), contentPadding = PaddingValues(bottom = paddingValues.calculateBottomPadding()) ) { when { @@ -323,7 +323,7 @@ private fun BlockedNumber( movableContentOf { Text( text = blockedNumber.contactName.toString(), - modifier = modifier.padding(horizontal = dimens.margin.medium, vertical = dimens.margin.extraSmall) + modifier = modifier.padding(horizontal = Dimens.margin.medium, vertical = Dimens.margin.extraSmall) ) } } @@ -380,7 +380,7 @@ private fun blockedNumberListItemColors( private fun BlockedNumberHeadlineContent(modifier: Modifier = Modifier, blockedNumber: BlockedNumber, hasContactName: Boolean) { Text( text = blockedNumber.number, - modifier = modifier.padding(horizontal = dimens.margin.medium), + modifier = modifier.padding(horizontal = Dimens.margin.medium), color = if (hasContactName) LocalContentColor.current.copy(alpha = 0.7f) else LocalContentColor.current ) } @@ -547,7 +547,7 @@ private fun NonActionModeToolbar( title = { scrolledTextColor -> Text( text = stringResource(id = R.string.manage_blocked_numbers), - modifier = Modifier.padding(start = dimens.margin.extraLarge), + modifier = Modifier.padding(start = Dimens.margin.extraLarge), maxLines = 1, overflow = TextOverflow.Ellipsis, color = scrolledTextColor @@ -583,8 +583,8 @@ private fun LazyListScope.emptyBlockedNumbers( style = TextStyle(fontStyle = FontStyle.Italic, textAlign = TextAlign.Center, color = MaterialTheme.colorScheme.onSurface), modifier = Modifier .fillMaxWidth() - .padding(top = dimens.margin.extraLarge, bottom = dimens.margin.small) - .padding(horizontal = dimens.margin.extraLarge) + .padding(top = Dimens.margin.extraLarge, bottom = Dimens.margin.small) + .padding(horizontal = Dimens.margin.extraLarge) ) } item { @@ -605,7 +605,7 @@ private fun LazyListScope.emptyBlockedNumbers( color = MaterialTheme.colorScheme.primary, fontSize = 18.sp ), - modifier = Modifier.padding(dimens.margin.medium) + modifier = Modifier.padding(Dimens.margin.medium) ) } } @@ -621,8 +621,8 @@ private fun LazyListScope.noPermissionToBlock( style = TextStyle(fontStyle = FontStyle.Italic, textAlign = TextAlign.Center), modifier = Modifier .fillMaxWidth() - .padding(top = dimens.margin.extraLarge) - .padding(horizontal = dimens.margin.extraLarge) + .padding(top = Dimens.margin.extraLarge) + .padding(horizontal = Dimens.margin.extraLarge) ) } item { @@ -643,7 +643,7 @@ private fun LazyListScope.noPermissionToBlock( color = MaterialTheme.colorScheme.primary, fontSize = 18.sp ), - modifier = Modifier.padding(dimens.margin.extraLarge) + modifier = Modifier.padding(Dimens.margin.extraLarge) ) } } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsCheckBoxComponent.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsCheckBoxComponent.kt index e7b62fc02..225370a88 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsCheckBoxComponent.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsCheckBoxComponent.kt @@ -16,7 +16,7 @@ import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.extensions.NoRippleTheme import com.simplemobiletools.commons.compose.extensions.rememberMutableInteractionSource import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens import com.simplemobiletools.commons.compose.theme.preferenceLabelColor import com.simplemobiletools.commons.compose.theme.preferenceValueColor @@ -54,7 +54,7 @@ fun SettingsCheckBoxComponent( Text( modifier = Modifier .fillMaxWidth() - .padding(end = dimens.margin.extraLarge), + .padding(end = Dimens.margin.extraLarge), text = label, color = preferenceLabelColor(isEnabled = isPreferenceEnabled), fontSize = 14.sp @@ -64,7 +64,7 @@ fun SettingsCheckBoxComponent( text = value.toString(), modifier = Modifier .fillMaxWidth() - .padding(end = dimens.margin.extraLarge), + .padding(end = Dimens.margin.extraLarge), color = preferenceValueColor(isEnabled = isPreferenceEnabled), ) } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsGroup.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsGroup.kt index 47f179feb..06cb48cba 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsGroup.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsGroup.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.simplemobiletools.commons.compose.extensions.MyDevices -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens @Composable fun SettingsGroup( @@ -35,7 +35,7 @@ fun SettingsGroupTitle( Box( modifier = modifier .fillMaxWidth() - .padding(horizontal = dimens.margin.extraLarge), + .padding(horizontal = Dimens.margin.extraLarge), contentAlignment = Alignment.CenterStart ) { val primary = MaterialTheme.colorScheme.primary diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsListItem.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsListItem.kt index a1741def3..8923a9856 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsListItem.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsListItem.kt @@ -22,7 +22,7 @@ import com.simplemobiletools.commons.R import com.simplemobiletools.commons.compose.extensions.BooleanPreviewParameterProvider import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens @Composable fun SettingsListItem( @@ -50,8 +50,8 @@ fun SettingsListItem( }, leadingContent = { val imageSize = Modifier - .size(dimens.icon.medium) - .padding(dimens.margin.medium) + .size(Dimens.icon.medium) + .padding(Dimens.margin.medium) when { icon != null && isImage && tint != null -> Image( modifier = imageSize, @@ -106,8 +106,8 @@ fun SettingsListItem( }, leadingContent = { val imageSize = Modifier - .size(dimens.icon.medium) - .padding(dimens.margin.medium) + .size(Dimens.icon.medium) + .padding(Dimens.margin.medium) when { icon != null && isImage && tint != null -> Image( modifier = imageSize, diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsTitleTextComponent.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsTitleTextComponent.kt index 28a459646..ad486e4ab 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsTitleTextComponent.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/SettingsTitleTextComponent.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.sp import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens @Composable fun SettingsTitleTextComponent( @@ -21,11 +21,11 @@ fun SettingsTitleTextComponent( maxLines: Int = 1, overflow: TextOverflow = TextOverflow.Ellipsis ) { - Box(modifier = Modifier.padding(top = dimens.margin.extraLarge)) { + Box(modifier = Modifier.padding(top = Dimens.margin.extraLarge)) { Text( text = text.uppercase(), modifier = modifier - .padding(horizontal = dimens.margin.small), + .padding(horizontal = Dimens.margin.small), color = color, fontSize = 14.sp, maxLines = maxLines, diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/scaffold/SettingsScaffoldTopBar.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/scaffold/SettingsScaffoldTopBar.kt index a33f5b0dd..3bdbb2d38 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/scaffold/SettingsScaffoldTopBar.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/settings/scaffold/SettingsScaffoldTopBar.kt @@ -20,7 +20,7 @@ import com.simplemobiletools.commons.R import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.extensions.rememberMutableInteractionSource import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.compose.theme.dimens +import com.simplemobiletools.commons.compose.theme.Dimens @Composable fun SettingsScaffoldTopBar( @@ -39,7 +39,7 @@ fun SettingsScaffoldTopBar( Text( text = title, modifier = Modifier - .padding(start = dimens.margin.medium) + .padding(start = Dimens.margin.medium) .fillMaxWidth(), color = scrolledColor, maxLines = 1, @@ -157,7 +157,7 @@ fun SettingsNavigationIcon( ) { Box( modifier - .padding(start = dimens.margin.medium) + .padding(start = Dimens.margin.medium) .clip(RoundedCornerShape(50)) .clickable( navigationIconInteractionSource, rememberRipple( @@ -175,13 +175,13 @@ fun BackIcon(iconColor: Color?) { if (iconColor == null) { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(id = R.string.back), - modifier = Modifier.padding(dimens.margin.small) + modifier = Modifier.padding(Dimens.margin.small) ) } else { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(id = R.string.back), tint = iconColor, - modifier = Modifier.padding(dimens.margin.small) + modifier = Modifier.padding(Dimens.margin.small) ) } } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/theme/Dimensions.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/theme/Dimensions.kt index b68b7e9bc..1f9c65e7a 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/theme/Dimensions.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/theme/Dimensions.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.unit.dp import com.simplemobiletools.commons.compose.theme.model.Dimensions -val dimens: Dimensions +val Dimens: Dimensions @Composable @ReadOnlyComposable get() = LocalDimensions.current