refactor: make Sizes experimental

This commit is contained in:
2024-01-04 05:40:39 +08:00
parent 2ce3de640b
commit 248f3b3e84
2 changed files with 17 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ kotlin {
sourceSets {
all {
languageSettings {
optIn("com.highcapable.flexiui.ExperimentalFlexiUISizesApi")
optIn("androidx.compose.ui.ExperimentalComposeUiApi")
optIn("androidx.compose.foundation.ExperimentalFoundationApi")
}

View File

@@ -28,8 +28,7 @@ import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
// TODO: Some sizes will modify in the future
@ExperimentalFlexiUISizesApi
@Immutable
data class Sizes(
val spacingPrimary: Dp,
@@ -61,4 +60,18 @@ internal val DefaultSizes = Sizes(
borderSizePrimary = 2.dp,
borderSizeSecondary = 1.dp,
borderSizeTertiary = 0.dp
)
)
/**
* The [Sizes] is experimental, the relevant design specifications for size are still being improved,
* this is the old design plan.
*
* Some sizes will modify in the future.
*/
@RequiresOptIn(
message = "The Sizes is experimental, the relevant design specifications for size are still being improved, this is the old design plan.\n" +
"Some sizes will modify in the future.",
level = RequiresOptIn.Level.WARNING
)
@MustBeDocumented
annotation class ExperimentalFlexiUISizesApi