-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
core/src/main/kotlin/com/imashnake/animite/core/ui/Paddings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.imashnake.animite.core.ui | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.dimensionResource | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.imashnake.animite.core.R | ||
|
||
data class Paddings( | ||
val ultraTiny: Dp, | ||
val tiny: Dp, | ||
val small: Dp, | ||
val medium: Dp, | ||
val large: Dp | ||
) { | ||
companion object { | ||
val ZERO = 0.dp | ||
} | ||
} | ||
|
||
val LocalPaddings = staticCompositionLocalOf<Paddings> { error("Paddings must be set!") } | ||
|
||
@Composable | ||
fun rememberDefaultPaddings(): Paddings { | ||
return Paddings( | ||
ultraTiny = dimensionResource(R.dimen.ultra_tiny_padding), | ||
tiny = dimensionResource(R.dimen.tiny_padding), | ||
small = dimensionResource(R.dimen.small_padding), | ||
medium = dimensionResource(R.dimen.medium_padding), | ||
large = dimensionResource(R.dimen.large_padding) | ||
) | ||
} |