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

[#543] Add default spacing definition in app dimensions #544

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ fun Item(
Row {
Text(
modifier = Modifier
.padding(dimensions.spacingNormal)
.padding(dimensions.spacingMedium)
.weight(1f),
text = uiModel.id
)
Text(
modifier = Modifier
.padding(dimensions.spacingNormal)
.padding(dimensions.spacingMedium)
.weight(2f),
text = uiModel.username
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import androidx.compose.ui.unit.dp

class AppDimensions {
// Custom dimensions here
val spacingNormal = 16.dp
val spacing2XSmall = 4.dp
val spacingXSmall = 8.dp
val spacingSmall = 12.dp
val spacingMedium = 16.dp
val spacingLarge = 20.dp
val spacingXLarge = 24.dp
val spacing2XLarge = 28.dp
val spacing3XLarge = 32.dp
}

internal val LocalAppDimensions = staticCompositionLocalOf { AppDimensions() }
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private fun HomeScreenContent(
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(all = dimensions.spacingNormal)
.padding(all = dimensions.spacingMedium)
)
}
Timber.d("Result : $uiModels")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import androidx.compose.ui.unit.dp

class AppDimensions {
// Custom dimensions here
val spacingNormal = 16.dp
val spacing2XSmall = 4.dp
val spacingXSmall = 8.dp
val spacingSmall = 12.dp
val spacingMedium = 16.dp
val spacingLarge = 20.dp
val spacingXLarge = 24.dp
val spacing2XLarge = 28.dp
val spacing3XLarge = 32.dp
}

internal val LocalAppDimensions = staticCompositionLocalOf { AppDimensions() }
Loading