Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add placeholders settings for the main setting screen #26

Merged
merged 13 commits into from
Aug 20, 2024
Merged
Prev Previous commit
Next Next commit
Extract missing dimension values in SettingsComponent and make all va…
…l uppercase
  • Loading branch information
LunarX committed Aug 20, 2024
commit 0b83f6f8a2cc0d80d00b48f8f5e7d2b80e8708b9
sirambd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -40,13 +40,15 @@ import com.infomaniak.swisstransfer.ui.icons.app.OpenOutside
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

private val horizontalMargin = Margin.Medium
private val verticalMargin = 12.dp

private val ITEM_MIN_HEIGHT = 56.dp
private val HORIZONTAL_MARGIN = Margin.Medium
private val VERTICAL_MARGIN = 12.dp

@Composable
fun SettingTitle(@StringRes titleRes: Int) {
Text(
modifier = Modifier.padding(horizontal = horizontalMargin, vertical = verticalMargin),
modifier = Modifier.padding(horizontal = HORIZONTAL_MARGIN, vertical = VERTICAL_MARGIN),
text = stringResource(id = titleRes),
style = SwissTransferTheme.typography.bodySmallRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
@@ -63,7 +65,7 @@ fun SettingItem(
) {
val modifier = Modifier
.fillMaxWidth()
.heightIn(min = 56.dp)
.heightIn(min = ITEM_MIN_HEIGHT)

onClick?.let {
SharpRippleButton(
@@ -89,7 +91,7 @@ private fun SettingItemContent(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = horizontalMargin, vertical = verticalMargin),
.padding(horizontal = HORIZONTAL_MARGIN, vertical = VERTICAL_MARGIN),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically,
) {
@@ -119,7 +121,7 @@ private fun SettingItemContent(

@Composable
fun SettingDivider() {
HorizontalDivider(modifier = Modifier.padding(horizontal = horizontalMargin, vertical = verticalMargin))
HorizontalDivider(modifier = Modifier.padding(horizontal = HORIZONTAL_MARGIN, vertical = VERTICAL_MARGIN))
}

@Preview
Loading