Rename dimensions for readability

This commit is contained in:
Andrew 2024-06-18 21:45:36 +09:30
parent 5e1b5b393c
commit 91f73010e0
20 changed files with 93 additions and 92 deletions

View File

@ -71,17 +71,17 @@ private fun ColumnScope.Items(
R.string.AccessibilityId_invite_friend_button), onClick = delegate::onInviteFriend) R.string.AccessibilityId_invite_friend_button), onClick = delegate::onInviteFriend)
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginMedium) .padding(horizontal = LocalDimensions.current.margin)
.padding(top = LocalDimensions.current.itemSpacingMedium) .padding(top = LocalDimensions.current.itemSpacing)
) { ) {
Text(stringResource(R.string.accountIdYours), style = xl) Text(stringResource(R.string.accountIdYours), style = xl)
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingTiny)) Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing))
Text( Text(
text = stringResource(R.string.qrYoursDescription), text = stringResource(R.string.qrYoursDescription),
color = LocalColors.current.textSecondary, color = LocalColors.current.textSecondary,
style = small style = small
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing))
QrImage(string = accountId, Modifier.contentDescription(R.string.AccessibilityId_qr_code)) QrImage(string = accountId, Modifier.contentDescription(R.string.AccessibilityId_qr_code))
} }
} }

View File

@ -37,7 +37,7 @@ internal fun InviteFriend(
Column(modifier = Modifier.background(LocalColors.current.backgroundSecondary)) { Column(modifier = Modifier.background(LocalColors.current.backgroundSecondary)) {
AppBar(stringResource(R.string.invite_a_friend), onBack = onBack, onClose = onClose) AppBar(stringResource(R.string.invite_a_friend), onBack = onBack, onClose = onClose)
Column( Column(
modifier = Modifier.padding(horizontal = LocalDimensions.current.itemSpacingMedium), modifier = Modifier.padding(horizontal = LocalDimensions.current.itemSpacing),
) { ) {
Text( Text(
accountId, accountId,
@ -45,24 +45,24 @@ internal fun InviteFriend(
.contentDescription(R.string.AccessibilityId_recovery_password_container) .contentDescription(R.string.AccessibilityId_recovery_password_container)
.fillMaxWidth() .fillMaxWidth()
.border() .border()
.padding(LocalDimensions.current.marginSmall), .padding(LocalDimensions.current.smallMargin),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = base style = base
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingXSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing))
Text( Text(
stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them), stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = small, style = small,
color = LocalColors.current.textSecondary, color = LocalColors.current.textSecondary,
modifier = Modifier.padding(horizontal = LocalDimensions.current.itemSpacingSmall) modifier = Modifier.padding(horizontal = LocalDimensions.current.smallItemSpacing)
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing))
Row(horizontalArrangement = spacedBy(LocalDimensions.current.itemSpacingSmall)) { Row(horizontalArrangement = spacedBy(LocalDimensions.current.smallItemSpacing)) {
SlimOutlineButton( SlimOutlineButton(
stringResource(R.string.share), stringResource(R.string.share),
modifier = Modifier modifier = Modifier

View File

@ -68,15 +68,15 @@ private fun EnterAccountId(
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginExtraExtraSmall, vertical = LocalDimensions.current.marginExtraSmall) .padding(horizontal = LocalDimensions.current.xxsMargin, vertical = LocalDimensions.current.xsMargin)
.fillMaxHeight(), .fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.marginExtraSmall) verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xsMargin)
) { ) {
SessionOutlinedTextField( SessionOutlinedTextField(
text = state.newMessageIdOrOns, text = state.newMessageIdOrOns,
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginSmall) .padding(horizontal = LocalDimensions.current.smallMargin)
.contentDescription("Session id input box"), .contentDescription("Session id input box"),
placeholder = stringResource(R.string.accountIdOrOnsEnter), placeholder = stringResource(R.string.accountIdOrOnsEnter),
onChange = callbacks::onChange, onChange = callbacks::onChange,
@ -91,14 +91,14 @@ private fun EnterAccountId(
modifier = Modifier modifier = Modifier
.animateContentSize() .animateContentSize()
.contentDescription(R.string.AccessibilityId_help_desk_link) .contentDescription(R.string.AccessibilityId_help_desk_link)
.padding(horizontal = LocalDimensions.current.marginMedium) .padding(horizontal = LocalDimensions.current.margin)
.fillMaxWidth(), .fillMaxWidth(),
) { onHelp() } ) { onHelp() }
OutlineButton( OutlineButton(
modifier = Modifier modifier = Modifier
.align(Alignment.CenterHorizontally) .align(Alignment.CenterHorizontally)
.padding(horizontal = LocalDimensions.current.marginLarge) .padding(horizontal = LocalDimensions.current.largeMargin)
.fillMaxWidth() .fillMaxWidth()
.contentDescription(R.string.next), .contentDescription(R.string.next),
color = LocalColors.current.primary, color = LocalColors.current.primary,

View File

@ -339,7 +339,7 @@ fun FileDetails(fileDetails: List<TitledText>) {
CellWithPaddingAndMargin(padding = 0.dp) { CellWithPaddingAndMargin(padding = 0.dp) {
FlowRow( FlowRow(
modifier = Modifier.padding(vertical = 24.dp, horizontal = LocalDimensions.current.itemSpacingXSmall), modifier = Modifier.padding(vertical = 24.dp, horizontal = LocalDimensions.current.xsItemSpacing),
verticalArrangement = Arrangement.spacedBy(16.dp) verticalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
fileDetails.forEach { fileDetails.forEach {
@ -348,7 +348,7 @@ fun FileDetails(fileDetails: List<TitledText>) {
it, it,
modifier = Modifier modifier = Modifier
.widthIn(min = maxWidth.div(2)) .widthIn(min = maxWidth.div(2))
.padding(horizontal = LocalDimensions.current.itemSpacingXSmall) .padding(horizontal = LocalDimensions.current.xsItemSpacing)
.width(IntrinsicSize.Max) .width(IntrinsicSize.Max)
) )
} }

View File

@ -32,7 +32,7 @@ internal fun EmptyView(newAccount: Boolean) {
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginHomeEmptyView) .padding(horizontal = LocalDimensions.current.homeEmptyViewMargin)
) { ) {
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
Icon( Icon(
@ -54,13 +54,13 @@ internal fun EmptyView(newAccount: Boolean) {
) )
} }
Divider(modifier = Modifier.padding(vertical = LocalDimensions.current.marginExtraSmall)) Divider(modifier = Modifier.padding(vertical = LocalDimensions.current.xsMargin))
Text( Text(
stringResource(R.string.conversationsNone), stringResource(R.string.conversationsNone),
style = h8, style = h8,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier.padding(bottom = LocalDimensions.current.itemSpacingXSmall)) modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing))
Text( Text(
stringResource(R.string.onboardingHitThePlusButton), stringResource(R.string.onboardingHitThePlusButton),
style = small, style = small,

View File

@ -44,8 +44,8 @@ internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) {
Modifier Modifier
.background(LocalColors.current.backgroundSecondary) .background(LocalColors.current.backgroundSecondary)
.padding( .padding(
horizontal = LocalDimensions.current.marginSmall, horizontal = LocalDimensions.current.smallMargin,
vertical = LocalDimensions.current.marginExtraSmall vertical = LocalDimensions.current.xsMargin
) )
) { ) {
Column(Modifier.weight(1f)) { Column(Modifier.weight(1f)) {
@ -54,7 +54,7 @@ internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) {
stringResource(R.string.save_your_recovery_password), stringResource(R.string.save_your_recovery_password),
style = h8 style = h8
) )
Spacer(Modifier.requiredWidth(LocalDimensions.current.itemSpacingXXSmall)) Spacer(Modifier.requiredWidth(LocalDimensions.current.xxsItemSpacing))
SessionShieldIcon() SessionShieldIcon()
} }
Text( Text(
@ -62,7 +62,7 @@ internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) {
style = small style = small
) )
} }
Spacer(Modifier.width(LocalDimensions.current.marginExtraExtraSmall)) Spacer(Modifier.width(LocalDimensions.current.xxsMargin))
SlimOutlineButton( SlimOutlineButton(
text = stringResource(R.string.continue_2), text = stringResource(R.string.continue_2),
modifier = Modifier modifier = Modifier

View File

@ -107,7 +107,7 @@ internal fun LandingScreen(
Column { Column {
Column(modifier = Modifier Column(modifier = Modifier
.weight(1f) .weight(1f)
.padding(horizontal = LocalDimensions.current.marginOnboarding) .padding(horizontal = LocalDimensions.current.onboardingMargin)
) { ) {
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
Text( Text(
@ -116,7 +116,7 @@ internal fun LandingScreen(
style = h4, style = h4,
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingMedium)) Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing))
LazyColumn( LazyColumn(
state = listState, state = listState,
@ -124,7 +124,7 @@ internal fun LandingScreen(
.heightIn(min = LocalDimensions.current.minScrollableViewHeight) .heightIn(min = LocalDimensions.current.minScrollableViewHeight)
.fillMaxWidth() .fillMaxWidth()
.weight(3f), .weight(3f),
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.itemSpacingSmall) verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing)
) { ) {
items( items(
MESSAGES.take(count), MESSAGES.take(count),
@ -140,7 +140,7 @@ internal fun LandingScreen(
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
} }
Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.marginLarge)) { Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin)) {
PrimaryFillButton( PrimaryFillButton(
text = stringResource(R.string.onboardingAccountCreate), text = stringResource(R.string.onboardingAccountCreate),
modifier = Modifier modifier = Modifier
@ -149,7 +149,7 @@ internal fun LandingScreen(
.contentDescription(R.string.AccessibilityId_create_account_button), .contentDescription(R.string.AccessibilityId_create_account_button),
onClick = createAccount onClick = createAccount
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing))
PrimaryOutlineButton( PrimaryOutlineButton(
stringResource(R.string.onboardingAccountExists), stringResource(R.string.onboardingAccountExists),
modifier = Modifier modifier = Modifier
@ -166,7 +166,7 @@ internal fun LandingScreen(
.contentDescription(R.string.AccessibilityId_open_url), .contentDescription(R.string.AccessibilityId_open_url),
onClick = { isUrlDialogVisible = true } onClick = { isUrlDialogVisible = true }
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingXXSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.xxsItemSpacing))
} }
} }
} }
@ -220,8 +220,8 @@ private fun MessageText(
style = large, style = large,
color = textColor, color = textColor,
modifier = Modifier.padding( modifier = Modifier.padding(
horizontal = LocalDimensions.current.itemSpacingSmall, horizontal = LocalDimensions.current.smallItemSpacing,
vertical = LocalDimensions.current.itemSpacingXSmall vertical = LocalDimensions.current.xsItemSpacing
) )
) )
} }

View File

@ -71,7 +71,7 @@ private fun PreviewRecoveryPassword() {
private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onContinue: () -> Unit = {}) { private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onContinue: () -> Unit = {}) {
Column { Column {
Column( Column(
modifier = Modifier.padding(horizontal = LocalDimensions.current.marginLarge) modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin)
.weight(1f) .weight(1f)
) { ) {
Spacer(Modifier.weight(1f)) Spacer(Modifier.weight(1f))
@ -80,18 +80,18 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo
stringResource(R.string.sessionRecoveryPassword), stringResource(R.string.sessionRecoveryPassword),
style = h4 style = h4
) )
Spacer(Modifier.width(LocalDimensions.current.itemSpacingXXSmall)) Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing))
Icon( Icon(
painter = painterResource(id = R.drawable.ic_shield_outline), painter = painterResource(id = R.drawable.ic_shield_outline),
contentDescription = null, contentDescription = null,
) )
} }
Spacer(Modifier.height(LocalDimensions.current.itemSpacingSmall)) Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing))
Text( 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), 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 = base style = base
) )
Spacer(Modifier.height(LocalDimensions.current.itemSpacingMedium)) Spacer(Modifier.height(LocalDimensions.current.itemSpacing))
SessionOutlinedTextField( SessionOutlinedTextField(
text = state.recoveryPhrase, text = state.recoveryPhrase,
modifier = Modifier modifier = Modifier

View File

@ -41,7 +41,7 @@ internal fun LoadingScreen(state: State) {
stringResource(R.string.waitOneMoment), stringResource(R.string.waitOneMoment),
style = h7 style = h7
) )
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingTiny)) Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing))
Text( Text(
stringResource(R.string.loadAccountProgressMessage), stringResource(R.string.loadAccountProgressMessage),
style = base style = base

View File

@ -46,11 +46,11 @@ internal fun MessageNotificationsScreen(
Column { Column {
Spacer(Modifier.weight(1f)) Spacer(Modifier.weight(1f))
Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.marginOnboarding)) { Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.onboardingMargin)) {
Text(stringResource(R.string.notificationsMessage), style = h4) Text(stringResource(R.string.notificationsMessage), style = h4)
Spacer(Modifier.height(LocalDimensions.current.marginExtraSmall)) Spacer(Modifier.height(LocalDimensions.current.xsMargin))
Text(stringResource(R.string.onboardingMessageNotificationExplaination), style = base) Text(stringResource(R.string.onboardingMessageNotificationExplaination), style = base)
Spacer(Modifier.height(LocalDimensions.current.itemSpacingMedium)) Spacer(Modifier.height(LocalDimensions.current.itemSpacing))
NotificationRadioButton( NotificationRadioButton(
R.string.activity_pn_mode_fast_mode, R.string.activity_pn_mode_fast_mode,
R.string.activity_pn_mode_fast_mode_explanation, R.string.activity_pn_mode_fast_mode_explanation,
@ -59,7 +59,7 @@ internal fun MessageNotificationsScreen(
selected = state.pushEnabled, selected = state.pushEnabled,
onClick = { setEnabled(true) } onClick = { setEnabled(true) }
) )
Spacer(Modifier.height(LocalDimensions.current.itemSpacingXSmall)) Spacer(Modifier.height(LocalDimensions.current.xsItemSpacing))
NotificationRadioButton( NotificationRadioButton(
R.string.activity_pn_mode_slow_mode, R.string.activity_pn_mode_slow_mode,
R.string.activity_pn_mode_slow_mode_explanation, R.string.activity_pn_mode_slow_mode_explanation,
@ -99,7 +99,7 @@ private fun NotificationRadioButton(
shape = RoundedCornerShape(8.dp) shape = RoundedCornerShape(8.dp)
) { ) {
Column( Column(
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.itemSpacingXXSmall) verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xxsItemSpacing)
) { ) {
Text(stringResource(title), style = h8) Text(stringResource(title), style = h8)
Text(stringResource(explanation), style = small) Text(stringResource(explanation), style = small)

View File

@ -36,17 +36,17 @@ internal fun DisplayName(state: State, onChange: (String) -> Unit = {}, onContin
Column { Column {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginOnboarding) .padding(horizontal = LocalDimensions.current.onboardingMargin)
.weight(1f) .weight(1f)
) { ) {
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
Text(stringResource(state.title), style = h4) Text(stringResource(state.title), style = h4)
Spacer(Modifier.height(LocalDimensions.current.itemSpacingSmall)) Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing))
Text( Text(
stringResource(state.description), stringResource(state.description),
style = base, style = base,
modifier = Modifier.padding(bottom = LocalDimensions.current.itemSpacingXSmall)) modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing))
Spacer(Modifier.height(LocalDimensions.current.itemSpacingMedium)) Spacer(Modifier.height(LocalDimensions.current.itemSpacing))
SessionOutlinedTextField( SessionOutlinedTextField(
text = state.displayName, text = state.displayName,
modifier = Modifier modifier = Modifier

View File

@ -17,8 +17,8 @@ fun ContinueButton(modifier: Modifier, onContinue: () -> Unit) {
modifier = modifier modifier = modifier
.contentDescription(R.string.AccessibilityId_continue) .contentDescription(R.string.AccessibilityId_continue)
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = LocalDimensions.current.marginLarge) .padding(horizontal = LocalDimensions.current.largeMargin)
.padding(bottom = LocalDimensions.current.marginExtraExtraSmall), .padding(bottom = LocalDimensions.current.xxsMargin),
onClick = onContinue, onClick = onContinue,
) )
} }
@ -29,8 +29,8 @@ fun OnboardingButton(text: String, modifier: Modifier, onClick: () -> Unit) {
text, text,
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = LocalDimensions.current.marginLarge) .padding(horizontal = LocalDimensions.current.largeMargin)
.padding(bottom = LocalDimensions.current.marginExtraExtraSmall), .padding(bottom = LocalDimensions.current.xxsMargin),
onClick = onClick, onClick = onClick,
) )
} }

View File

@ -93,13 +93,13 @@ fun QrPage(string: String) {
Column( Column(
modifier = Modifier modifier = Modifier
.background(LocalColors.current.backgroundSecondary) .background(LocalColors.current.backgroundSecondary)
.padding(horizontal = LocalDimensions.current.marginMedium) .padding(horizontal = LocalDimensions.current.margin)
.fillMaxSize() .fillMaxSize()
) { ) {
QrImage( QrImage(
string = string, string = string,
modifier = Modifier modifier = Modifier
.padding(top = LocalDimensions.current.marginMedium, bottom = LocalDimensions.current.marginExtraExtraSmall) .padding(top = LocalDimensions.current.margin, bottom = LocalDimensions.current.xxsMargin)
.contentDescription(R.string.AccessibilityId_qr_code), .contentDescription(R.string.AccessibilityId_qr_code),
icon = R.drawable.session icon = R.drawable.session
) )

View File

@ -387,9 +387,9 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
Column { Column {
Row( Row(
modifier = Modifier modifier = Modifier
.padding(horizontal = LocalDimensions.current.marginSmall) .padding(horizontal = LocalDimensions.current.smallMargin)
.padding(top = LocalDimensions.current.marginTiny), .padding(top = LocalDimensions.current.xxxsMargin),
horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.itemSpacingSmall), horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing),
) { ) {
OutlineButton( OutlineButton(
stringResource(R.string.share), stringResource(R.string.share),
@ -403,7 +403,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
) )
} }
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingMedium)) Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing))
var hasPaths by remember { var hasPaths by remember {
mutableStateOf(false) mutableStateOf(false)

View File

@ -47,11 +47,11 @@ internal fun RecoveryPasswordScreen(
onHide:() -> Unit = {} onHide:() -> Unit = {}
) { ) {
Column( Column(
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.marginExtraSmall), verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xsMargin),
modifier = Modifier modifier = Modifier
.contentDescription(R.string.AccessibilityId_recovery_password) .contentDescription(R.string.AccessibilityId_recovery_password)
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
.padding(bottom = LocalDimensions.current.marginExtraSmall) .padding(bottom = LocalDimensions.current.xsMargin)
) { ) {
RecoveryPasswordCell(seed, copySeed) RecoveryPasswordCell(seed, copySeed)
HideRecoveryPasswordCell(onHide) HideRecoveryPasswordCell(onHide)
@ -71,11 +71,11 @@ private fun RecoveryPasswordCell(seed: String, copySeed:() -> Unit = {}) {
stringResource(R.string.sessionRecoveryPassword), stringResource(R.string.sessionRecoveryPassword),
style = h8 style = h8
) )
Spacer(Modifier.width(LocalDimensions.current.itemSpacingXXSmall)) Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing))
SessionShieldIcon() SessionShieldIcon()
} }
Spacer(modifier = Modifier.height(LocalDimensions.current.marginTiny)) Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsMargin))
Text( Text(
stringResource(R.string.recoveryPasswordDescription), stringResource(R.string.recoveryPasswordDescription),
@ -93,7 +93,7 @@ private fun RecoveryPasswordCell(seed: String, copySeed:() -> Unit = {}) {
QrImage( QrImage(
seed, seed,
modifier = Modifier modifier = Modifier
.padding(vertical = LocalDimensions.current.marginSmall) .padding(vertical = LocalDimensions.current.smallMargin)
.contentDescription(R.string.AccessibilityId_qr_code), .contentDescription(R.string.AccessibilityId_qr_code),
icon = R.drawable.session_shield icon = R.drawable.session_shield
) )
@ -101,7 +101,7 @@ private fun RecoveryPasswordCell(seed: String, copySeed:() -> Unit = {}) {
AnimatedVisibility(!showQr) { AnimatedVisibility(!showQr) {
Row( Row(
horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.itemSpacingSmall), horizontalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallItemSpacing),
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
SlimOutlineCopyButton( SlimOutlineCopyButton(
@ -131,9 +131,9 @@ private fun RecoveryPassword(seed: String) {
seed, seed,
modifier = Modifier modifier = Modifier
.contentDescription(R.string.AccessibilityId_recovery_password_container) .contentDescription(R.string.AccessibilityId_recovery_password_container)
.padding(vertical = LocalDimensions.current.marginSmall) .padding(vertical = LocalDimensions.current.smallMargin)
.border() .border()
.padding(LocalDimensions.current.marginSmall), .padding(LocalDimensions.current.smallMargin),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = extraSmallMonospace, style = extraSmallMonospace,
color = LocalColors.current.run { if (isLight) text else primary }, color = LocalColors.current.run { if (isLight) text else primary },
@ -156,7 +156,7 @@ private fun HideRecoveryPasswordCell(onHide: () -> Unit = {}) {
style = base style = base
) )
} }
Spacer(modifier = Modifier.width(LocalDimensions.current.marginExtraExtraSmall)) Spacer(modifier = Modifier.width(LocalDimensions.current.xxsMargin))
SlimOutlineButton( SlimOutlineButton(
text = stringResource(R.string.hide), text = stringResource(R.string.hide),
modifier = Modifier modifier = Modifier

View File

@ -56,15 +56,15 @@ fun AlertDialog(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(top = LocalDimensions.current.itemSpacingSmall) .padding(top = LocalDimensions.current.smallItemSpacing)
.padding(horizontal = LocalDimensions.current.itemSpacingSmall) .padding(horizontal = LocalDimensions.current.smallItemSpacing)
) { ) {
title?.let { title?.let {
Text( Text(
it, it,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = h7, style = h7,
modifier = Modifier.padding(bottom = LocalDimensions.current.itemSpacingXXSmall) modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing)
) )
} }
text?.let { text?.let {
@ -72,7 +72,7 @@ fun AlertDialog(
it, it,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = large, style = large,
modifier = Modifier.padding(bottom = LocalDimensions.current.itemSpacingXXSmall) modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing)
) )
} }
} }
@ -109,8 +109,8 @@ fun DialogButton(text: String, modifier: Modifier, onClick: () -> Unit) {
color = LocalColors.current.text, color = LocalColors.current.text,
style = largeBold, style = largeBold,
modifier = Modifier.padding( modifier = Modifier.padding(
top = LocalDimensions.current.itemSpacingSmall, top = LocalDimensions.current.smallItemSpacing,
bottom = LocalDimensions.current.itemSpacingMedium bottom = LocalDimensions.current.itemSpacing
) )
) )
} }

View File

@ -326,7 +326,7 @@ fun Modifier.fadingEdges(
@Composable @Composable
fun Divider(modifier: Modifier = Modifier, startIndent: Dp = 0.dp) { fun Divider(modifier: Modifier = Modifier, startIndent: Dp = 0.dp) {
androidx.compose.material.Divider( androidx.compose.material.Divider(
modifier = modifier.padding(horizontal = LocalDimensions.current.marginExtraSmall), modifier = modifier.padding(horizontal = LocalDimensions.current.xsMargin),
color = LocalColors.current.divider, color = LocalColors.current.divider,
startIndent = startIndent startIndent = startIndent
) )

View File

@ -7,23 +7,24 @@ import androidx.compose.ui.unit.dp
val LocalDimensions = staticCompositionLocalOf { Dimensions() } val LocalDimensions = staticCompositionLocalOf { Dimensions() }
data class Dimensions( data class Dimensions(
val itemSpacingTiny: Dp = 4.dp, val xxxsItemSpacing: Dp = 4.dp,
val itemSpacingXXSmall: Dp = 8.dp, val xxsItemSpacing: Dp = 8.dp,
val itemSpacingXSmall: Dp = 12.dp, val xsItemSpacing: Dp = 12.dp,
val itemSpacingSmall: Dp = 16.dp, val smallItemSpacing: Dp = 16.dp,
val itemSpacingOnboarding: Dp = 20.dp, val itemSpacing: Dp = 24.dp,
val itemSpacingMedium: Dp = 24.dp,
val marginTiny: Dp = 8.dp, val xxxsMargin: Dp = 8.dp,
val marginExtraExtraSmall: Dp = 12.dp, val xxsMargin: Dp = 12.dp,
val marginExtraSmall: Dp = 16.dp, val xsMargin: Dp = 16.dp,
val marginSmall: Dp = 24.dp, val smallMargin: Dp = 24.dp,
val marginMedium: Dp = 32.dp, val margin: Dp = 32.dp,
val marginOnboarding: Dp = 36.dp, val onboardingMargin: Dp = 36.dp,
val marginLarge: Dp = 64.dp, val largeMargin: Dp = 64.dp,
val homeEmptyViewMargin: Dp = 50.dp,
val dividerIndent: Dp = 80.dp, val dividerIndent: Dp = 80.dp,
val appBarHeight: Dp = 64.dp, val appBarHeight: Dp = 64.dp,
val minScrollableViewHeight: Dp = 200.dp, val minScrollableViewHeight: Dp = 200.dp,
val marginHomeEmptyView: Dp = 50.dp,
val indicatorHeight: Dp = 4.dp, val indicatorHeight: Dp = 4.dp,
val borderStroke: Dp = 1.dp val borderStroke: Dp = 1.dp

View File

@ -95,7 +95,7 @@ fun MaybeScanQrCode(
style = base, style = base,
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
Spacer(modifier = Modifier.size(LocalDimensions.current.itemSpacingMedium)) Spacer(modifier = Modifier.size(LocalDimensions.current.itemSpacing))
OutlineButton( OutlineButton(
stringResource(R.string.sessionSettings), stringResource(R.string.sessionSettings),
modifier = Modifier.align(Alignment.CenterHorizontally), modifier = Modifier.align(Alignment.CenterHorizontally),
@ -103,7 +103,7 @@ fun MaybeScanQrCode(
) )
} }
} else { } else {
Box(modifier = Modifier.fillMaxSize().padding(LocalDimensions.current.marginLarge)) { Box(modifier = Modifier.fillMaxSize().padding(LocalDimensions.current.largeMargin)) {
SlimOutlineButton( SlimOutlineButton(
stringResource(R.string.cameraGrantAccess), stringResource(R.string.cameraGrantAccess),
modifier = Modifier modifier = Modifier
@ -163,11 +163,11 @@ fun ScanQrCode(errors: Flow<String>, onScan: (String) -> Unit) {
snackbarHost = { snackbarHost = {
SnackbarHost( SnackbarHost(
hostState = scaffoldState.snackbarHostState, hostState = scaffoldState.snackbarHostState,
modifier = Modifier.padding(LocalDimensions.current.itemSpacingSmall) modifier = Modifier.padding(LocalDimensions.current.smallItemSpacing)
) { data -> ) { data ->
Snackbar( Snackbar(
snackbarData = data, snackbarData = data,
modifier = Modifier.padding(LocalDimensions.current.itemSpacingSmall) modifier = Modifier.padding(LocalDimensions.current.smallItemSpacing)
) )
} }
} }
@ -181,7 +181,7 @@ fun ScanQrCode(errors: Flow<String>, onScan: (String) -> Unit) {
Box( Box(
Modifier Modifier
.aspectRatio(1f) .aspectRatio(1f)
.padding(LocalDimensions.current.itemSpacingMedium) .padding(LocalDimensions.current.itemSpacing)
.clip(shape = RoundedCornerShape(26.dp)) .clip(shape = RoundedCornerShape(26.dp))
.background(Color(0x33ffffff)) .background(Color(0x33ffffff))
.align(Alignment.Center) .align(Alignment.Center)

View File

@ -66,7 +66,7 @@ fun SessionOutlinedTextField(
shape = MaterialTheme.shapes.small shape = MaterialTheme.shapes.small
) )
error?.let { error?.let {
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingXSmall)) Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing))
Text( Text(
it, it,
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),