Skip to content

Commit

Permalink
[#543] Add default spacing dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangnguyen92dn committed Oct 19, 2023
1 parent ce05d6b commit 06dc8f5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
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() }

0 comments on commit 06dc8f5

Please sign in to comment.