From bb630fc11b01409c86086a0f4a37e15cd4bcdd21 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 15 Jul 2024 10:51:24 +1000 Subject: [PATCH] renaming spacing to be more general --- .../ui/DisappearingMessages.kt | 2 +- .../start/home/StartConversation.kt | 6 +++--- .../start/invitefriend/InviteFriend.kt | 10 +++++----- .../conversation/v2/MessageDetailActivity.kt | 18 +++++++++--------- .../thoughtcrime/securesms/home/EmptyView.kt | 2 +- .../securesms/home/SeedReminder.kt | 2 +- .../securesms/onboarding/landing/Landing.kt | 12 ++++++------ .../onboarding/loadaccount/LoadAccount.kt | 10 +++++----- .../securesms/onboarding/loading/Loading.kt | 2 +- .../MessageNotifications.kt | 2 +- .../onboarding/pickname/PickDisplayName.kt | 10 +++++----- .../securesms/preferences/SettingsActivity.kt | 4 ++-- .../recoverypassword/RecoveryPassword.kt | 4 ++-- .../thoughtcrime/securesms/ui/AlertDialog.kt | 12 ++++++------ .../thoughtcrime/securesms/ui/Components.kt | 4 ++-- .../thoughtcrime/securesms/ui/components/QR.kt | 10 +++++----- .../securesms/ui/components/QrImage.kt | 2 +- .../securesms/ui/components/Text.kt | 2 +- .../securesms/ui/theme/Dimensions.kt | 10 +++++----- 19 files changed, 62 insertions(+), 62 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/ui/DisappearingMessages.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/ui/DisappearingMessages.kt index bff32928db..93df7261a1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/ui/DisappearingMessages.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/ui/DisappearingMessages.kt @@ -46,7 +46,7 @@ fun DisappearingMessages( .padding(bottom = 20.dp) .verticalScroll(scrollState) .fadingEdges(scrollState), - verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing) + verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing) ) { state.cards.forEach { OptionsCard(it, callbacks) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/home/StartConversation.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/home/StartConversation.kt index 66a84d27d2..c422d93a9d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/home/StartConversation.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/home/StartConversation.kt @@ -74,17 +74,17 @@ internal fun StartConversationScreen( Column( modifier = Modifier .padding(horizontal = LocalDimensions.current.margin) - .padding(top = LocalDimensions.current.itemSpacing) + .padding(top = LocalDimensions.current.spacing) .padding(bottom = LocalDimensions.current.margin) ) { Text(stringResource(R.string.accountIdYours), style = LocalType.current.xl) - Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsSpacing)) Text( text = stringResource(R.string.qrYoursDescription), color = LocalColors.current.textSecondary, style = LocalType.current.small ) - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) QrImage( string = accountId, Modifier.contentDescription(R.string.AccessibilityId_qr_code), diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/invitefriend/InviteFriend.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/invitefriend/InviteFriend.kt index e8290be267..e20651c070 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/invitefriend/InviteFriend.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/invitefriend/InviteFriend.kt @@ -36,7 +36,7 @@ internal fun InviteFriend( Column(modifier = Modifier.background(LocalColors.current.backgroundSecondary)) { AppBar(stringResource(R.string.invite_a_friend), onBack = onBack, onClose = onClose) Column( - modifier = Modifier.padding(horizontal = LocalDimensions.current.itemSpacing), + modifier = Modifier.padding(horizontal = LocalDimensions.current.spacing), ) { Text( accountId, @@ -49,19 +49,19 @@ internal fun InviteFriend( style = LocalType.current.base ) - Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.xsSpacing)) Text( stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them), textAlign = TextAlign.Center, style = LocalType.current.small, color = LocalColors.current.textSecondary, - modifier = Modifier.padding(horizontal = LocalDimensions.current.smallItemSpacing) + modifier = Modifier.padding(horizontal = LocalDimensions.current.smallSpacing) ) - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) - Row(horizontalArrangement = spacedBy(LocalDimensions.current.smallItemSpacing)) { + Row(horizontalArrangement = spacedBy(LocalDimensions.current.smallSpacing)) { SlimOutlineButton( stringResource(R.string.share), modifier = Modifier diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt index a1adb8bd6d..b67ae10aaa 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt @@ -151,8 +151,8 @@ fun MessageDetails( Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = LocalDimensions.current.smallItemSpacing), - verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing) + .padding(vertical = LocalDimensions.current.smallSpacing), + verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing) ) { state.record?.let { message -> AndroidView( @@ -192,7 +192,7 @@ fun CellMetadata( state.apply { if (listOfNotNull(sent, received, error, senderInfo).isEmpty()) return CellWithPaddingAndMargin { - Column(verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing)) { + Column(verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing)) { TitledText(sent) TitledText(received) TitledErrorText(error) @@ -250,7 +250,7 @@ fun Carousel(attachments: List, onClick: (Int) -> Unit) { val pagerState = rememberPagerState { attachments.size } - Column(verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing)) { + Column(verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing)) { Row { CarouselPrevButton(pagerState) Box(modifier = Modifier.weight(1f)) { @@ -259,7 +259,7 @@ fun Carousel(attachments: List, onClick: (Int) -> Unit) { ExpandButton( modifier = Modifier .align(Alignment.BottomEnd) - .padding(LocalDimensions.current.xxsItemSpacing) + .padding(LocalDimensions.current.xxsSpacing) ) { onClick(pagerState.currentPage) } } CarouselNextButton(pagerState) @@ -339,8 +339,8 @@ fun FileDetails(fileDetails: List) { Cell { FlowRow( - modifier = Modifier.padding(horizontal = LocalDimensions.current.xsItemSpacing, vertical = LocalDimensions.current.itemSpacing), - verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing) + modifier = Modifier.padding(horizontal = LocalDimensions.current.xsSpacing, vertical = LocalDimensions.current.spacing), + verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing) ) { fileDetails.forEach { BoxWithConstraints { @@ -348,7 +348,7 @@ fun FileDetails(fileDetails: List) { it, modifier = Modifier .widthIn(min = maxWidth.div(2)) - .padding(horizontal = LocalDimensions.current.xsItemSpacing) + .padding(horizontal = LocalDimensions.current.xsSpacing) .width(IntrinsicSize.Max) ) } @@ -395,7 +395,7 @@ fun TitledText( @Composable fun TitledView(title: GetString, modifier: Modifier = Modifier, content: @Composable () -> Unit) { - Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xxxsItemSpacing)) { + Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xxxsSpacing)) { Text(title.string(), style = LocalType.current.base.bold()) content() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/EmptyView.kt b/app/src/main/java/org/thoughtcrime/securesms/home/EmptyView.kt index 201018ded7..a6acb49e93 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/EmptyView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/EmptyView.kt @@ -56,7 +56,7 @@ internal fun EmptyView(newAccount: Boolean) { stringResource(R.string.conversationsNone), style = LocalType.current.h8, textAlign = TextAlign.Center, - modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) + modifier = Modifier.padding(bottom = LocalDimensions.current.xsSpacing)) Text( stringResource(R.string.onboardingHitThePlusButton), style = LocalType.current.small, diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/SeedReminder.kt b/app/src/main/java/org/thoughtcrime/securesms/home/SeedReminder.kt index 376f0392ba..177b59fa81 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/SeedReminder.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/SeedReminder.kt @@ -52,7 +52,7 @@ internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) { stringResource(R.string.save_your_recovery_password), style = LocalType.current.h8 ) - Spacer(Modifier.requiredWidth(LocalDimensions.current.xxsItemSpacing)) + Spacer(Modifier.requiredWidth(LocalDimensions.current.xxsSpacing)) SessionShieldIcon() } Text( diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/landing/Landing.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/landing/Landing.kt index a7ce5bd545..c0cd2a97e1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/landing/Landing.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/landing/Landing.kt @@ -115,7 +115,7 @@ internal fun LandingScreen( style = LocalType.current.h4, textAlign = TextAlign.Center ) - Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.spacing)) LazyColumn( state = listState, @@ -123,7 +123,7 @@ internal fun LandingScreen( .heightIn(min = LocalDimensions.current.minScrollableViewHeight) .fillMaxWidth() .weight(3f), - verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing) + verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing) ) { items( MESSAGES.take(count), @@ -148,7 +148,7 @@ internal fun LandingScreen( .contentDescription(R.string.AccessibilityId_create_account_button), onClick = createAccount ) - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) PrimaryOutlineButton( stringResource(R.string.onboardingAccountExists), modifier = Modifier @@ -165,7 +165,7 @@ internal fun LandingScreen( .contentDescription(R.string.AccessibilityId_open_url), onClick = { isUrlDialogVisible = true } ) - Spacer(modifier = Modifier.height(LocalDimensions.current.xxsItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.xxsSpacing)) } } } @@ -219,8 +219,8 @@ private fun MessageText( style = LocalType.current.large, color = textColor, modifier = Modifier.padding( - horizontal = LocalDimensions.current.smallItemSpacing, - vertical = LocalDimensions.current.xsItemSpacing + horizontal = LocalDimensions.current.smallSpacing, + vertical = LocalDimensions.current.xsSpacing ) ) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccount.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccount.kt index 0284b8bb42..ccee3881ae 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccount.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccount.kt @@ -74,7 +74,7 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo .verticalScroll(rememberScrollState()) ) { Spacer(Modifier.weight(1f)) - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) Column( modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin) @@ -84,19 +84,19 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo text = stringResource(R.string.sessionRecoveryPassword), style = LocalType.current.h4 ) - Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) + Spacer(Modifier.width(LocalDimensions.current.xxsSpacing)) Icon( modifier = Modifier.align(Alignment.CenterVertically), painter = painterResource(id = R.drawable.ic_shield_outline), contentDescription = null, ) } - Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(Modifier.height(LocalDimensions.current.smallSpacing)) Text( stringResource(R.string.activity_link_enter_your_recovery_password_to_load_your_account_if_you_haven_t_saved_it_you_can_find_it_in_your_app_settings), style = LocalType.current.base ) - Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) + Spacer(Modifier.height(LocalDimensions.current.spacing)) SessionOutlinedTextField( text = state.recoveryPhrase, modifier = Modifier.fillMaxWidth(), @@ -109,7 +109,7 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo ) } - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) Spacer(Modifier.weight(2f)) ContinuePrimaryOutlineButton(modifier = Modifier.align(Alignment.CenterHorizontally), onContinue) diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/Loading.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/Loading.kt index d03f5ff9ab..40468bab20 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/Loading.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/Loading.kt @@ -26,7 +26,7 @@ internal fun LoadingScreen(progress: Float) { stringResource(R.string.waitOneMoment), style = LocalType.current.h7 ) - Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsSpacing)) Text( stringResource(R.string.loadAccountProgressMessage), style = LocalType.current.base diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/messagenotifications/MessageNotifications.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/messagenotifications/MessageNotifications.kt index b3116e038b..06e5dd660a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/messagenotifications/MessageNotifications.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/messagenotifications/MessageNotifications.kt @@ -60,7 +60,7 @@ internal fun MessageNotificationsScreen( Text(stringResource(R.string.notificationsMessage), style = LocalType.current.h4) Spacer(Modifier.height(LocalDimensions.current.xsMargin)) Text(stringResource(R.string.onboardingMessageNotificationExplaination), style = LocalType.current.base) - Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) + Spacer(Modifier.height(LocalDimensions.current.spacing)) } NotificationRadioButton( diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/pickname/PickDisplayName.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/pickname/PickDisplayName.kt index b39f00fcb8..e8563ca348 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/pickname/PickDisplayName.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/pickname/PickDisplayName.kt @@ -51,18 +51,18 @@ internal fun PickDisplayName( .verticalScroll(rememberScrollState()) ) { Spacer(Modifier.weight(1f)) - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) Column( modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin) ) { Text(stringResource(state.title), style = LocalType.current.h4) - Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(Modifier.height(LocalDimensions.current.smallSpacing)) Text( stringResource(state.description), style = LocalType.current.base, - modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) - Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) + modifier = Modifier.padding(bottom = LocalDimensions.current.xsSpacing)) + Spacer(Modifier.height(LocalDimensions.current.spacing)) SessionOutlinedTextField( text = state.displayName, modifier = Modifier.fillMaxWidth(), @@ -75,7 +75,7 @@ internal fun PickDisplayName( ) } - Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing)) Spacer(Modifier.weight(2f)) ContinuePrimaryOutlineButton(modifier = Modifier.align(Alignment.CenterHorizontally), onContinue) diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt index 84a3376be4..15182df57b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt @@ -431,7 +431,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() { modifier = Modifier .padding(horizontal = LocalDimensions.current.smallMargin) .padding(top = LocalDimensions.current.xxxsMargin), - horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing), + horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing), ) { PrimaryOutlineButton( stringResource(R.string.share), @@ -445,7 +445,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() { ) } - Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.spacing)) val hasPaths by hasPaths().collectAsState(initial = false) diff --git a/app/src/main/java/org/thoughtcrime/securesms/recoverypassword/RecoveryPassword.kt b/app/src/main/java/org/thoughtcrime/securesms/recoverypassword/RecoveryPassword.kt index c602fb638c..f1e90442f8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/recoverypassword/RecoveryPassword.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/recoverypassword/RecoveryPassword.kt @@ -76,7 +76,7 @@ private fun RecoveryPasswordCell( stringResource(R.string.sessionRecoveryPassword), style = LocalType.current.h8 ) - Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) + Spacer(Modifier.width(LocalDimensions.current.xxsSpacing)) SessionShieldIcon() } @@ -107,7 +107,7 @@ private fun RecoveryPasswordCell( AnimatedVisibility(!showQr) { Row( - horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing), + horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing), verticalAlignment = Alignment.CenterVertically ) { SlimOutlineCopyButton( diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt index a09512db8f..780a04581b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt @@ -73,15 +73,15 @@ fun AlertDialog( horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier .fillMaxWidth() - .padding(top = LocalDimensions.current.smallItemSpacing) - .padding(horizontal = LocalDimensions.current.smallItemSpacing) + .padding(top = LocalDimensions.current.smallSpacing) + .padding(horizontal = LocalDimensions.current.smallSpacing) ) { title?.let { Text( it, textAlign = TextAlign.Center, style = LocalType.current.h7, - modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) + modifier = Modifier.padding(bottom = LocalDimensions.current.xxsSpacing) ) } text?.let { @@ -89,7 +89,7 @@ fun AlertDialog( it, textAlign = TextAlign.Center, style = LocalType.current.large, - modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) + modifier = Modifier.padding(bottom = LocalDimensions.current.xxsSpacing) ) } content() @@ -130,8 +130,8 @@ fun DialogButton(text: String, modifier: Modifier, color: Color = Color.Unspecif style = LocalType.current.large.bold(), textAlign = TextAlign.Center, modifier = Modifier.padding( - top = LocalDimensions.current.smallItemSpacing, - bottom = LocalDimensions.current.itemSpacing + top = LocalDimensions.current.smallSpacing, + bottom = LocalDimensions.current.spacing ) ) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt index 9b40f9e874..a65f5133c4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt @@ -226,7 +226,7 @@ fun ItemButton( text, Modifier .fillMaxWidth() - .padding(vertical = LocalDimensions.current.xsItemSpacing) + .padding(vertical = LocalDimensions.current.xsSpacing) .align(Alignment.CenterVertically), style = textStyle ) @@ -269,7 +269,7 @@ fun CellWithPaddingAndMargin( fun TitledRadioButton(option: RadioOption, onClick: () -> Unit) { val color = if (option.enabled) LocalColors.current.text else LocalColors.current.disabled Row( - horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing), + horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing), modifier = Modifier .runIf(option.enabled) { clickable { if (!option.selected) onClick() } } .heightIn(min = 60.dp) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/QR.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/QR.kt index 4abc9eec6b..57dba92e0f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/QR.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/QR.kt @@ -96,7 +96,7 @@ fun MaybeScanQrCode( style = LocalType.current.base, textAlign = TextAlign.Center ) - Spacer(modifier = Modifier.size(LocalDimensions.current.itemSpacing)) + Spacer(modifier = Modifier.size(LocalDimensions.current.spacing)) OutlineButton( stringResource(R.string.sessionSettings), modifier = Modifier.align(Alignment.CenterHorizontally), @@ -114,7 +114,7 @@ fun MaybeScanQrCode( Spacer(modifier = Modifier.weight(1f)) Text(stringResource(R.string.fragment_scan_qr_code_camera_access_explanation), style = LocalType.current.xl, textAlign = TextAlign.Center) - Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.spacing)) PrimaryOutlineButton( stringResource(R.string.cameraGrantAccess), modifier = Modifier.fillMaxWidth(), @@ -186,11 +186,11 @@ fun ScanQrCode(errors: Flow, onScan: (String) -> Unit) { snackbarHost = { SnackbarHost( hostState = scaffoldState.snackbarHostState, - modifier = Modifier.padding(LocalDimensions.current.smallItemSpacing) + modifier = Modifier.padding(LocalDimensions.current.smallSpacing) ) { data -> Snackbar( snackbarData = data, - modifier = Modifier.padding(LocalDimensions.current.smallItemSpacing) + modifier = Modifier.padding(LocalDimensions.current.smallSpacing) ) } } @@ -204,7 +204,7 @@ fun ScanQrCode(errors: Flow, onScan: (String) -> Unit) { Box( Modifier .aspectRatio(1f) - .padding(LocalDimensions.current.itemSpacing) + .padding(LocalDimensions.current.spacing) .clip(shape = RoundedCornerShape(26.dp)) .background(Color(0x33ffffff)) .align(Alignment.Center) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/QrImage.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/QrImage.kt index 74713fa5a8..c8c476244d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/QrImage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/QrImage.kt @@ -40,7 +40,7 @@ import org.thoughtcrime.securesms.util.QRCodeUtilities fun QrImage( string: String?, modifier: Modifier = Modifier, - contentPadding: Dp = LocalDimensions.current.smallItemSpacing, + contentPadding: Dp = LocalDimensions.current.smallSpacing, icon: Int = R.drawable.session_shield ) { var bitmap: Bitmap? by remember { diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Text.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Text.kt index e111a9916d..b7edb0dd56 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Text.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Text.kt @@ -130,7 +130,7 @@ fun SessionOutlinedTextField( ) } error?.let { - Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing)) + Spacer(modifier = Modifier.height(LocalDimensions.current.xsSpacing)) Text( it, modifier = Modifier.fillMaxWidth() diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/theme/Dimensions.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/theme/Dimensions.kt index 944b62ae03..f078e24bbe 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/theme/Dimensions.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/theme/Dimensions.kt @@ -7,11 +7,11 @@ import androidx.compose.ui.unit.dp val LocalDimensions = staticCompositionLocalOf { Dimensions() } data class Dimensions( - val xxxsItemSpacing: Dp = 4.dp, - val xxsItemSpacing: Dp = 8.dp, - val xsItemSpacing: Dp = 12.dp, - val smallItemSpacing: Dp = 16.dp, - val itemSpacing: Dp = 24.dp, + val xxxsSpacing: Dp = 4.dp, + val xxsSpacing: Dp = 8.dp, + val xsSpacing: Dp = 12.dp, + val smallSpacing: Dp = 16.dp, + val spacing: Dp = 24.dp, val xxxsMargin: Dp = 8.dp, val xxsMargin: Dp = 12.dp,