Skip to content

Commit

Permalink
Bump the project version, add 2 opt-in annotations ExperimentalApi
Browse files Browse the repository at this point in the history
…and `LikelyInconsistentApi`, and mark the `Modifier.wrapContent...()` modifier functions with them
  • Loading branch information
ShreckYe committed Dec 7, 2024
1 parent fb7f41a commit 1d1f9b1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/VersionsAndDependencies.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.huanshankeji.CommonDependencies
import org.jetbrains.compose.ComposeBuildConfig

val projectVersion = "0.5.0-SNAPSHOT"
val projectVersion = "0.5.1-SNAPSHOT"

val commonDependencies = CommonDependencies()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.huanshankeji.compose

@RequiresOptIn(
"This API is experimental. It could change in the future without notice.",
RequiresOptIn.Level.WARNING
)
@Retention(AnnotationRetention.BINARY)
annotation class ExperimentalApi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.huanshankeji.compose

@RequiresOptIn(
"This API is likely to be inconsistent now on Compose UI and Compose HTML, which could affect the final visual effect. " +
"Please verify on both kinds of targets to make sure it works as expected.",
RequiresOptIn.Level.WARNING
)
@Retention(AnnotationRetention.BINARY)
annotation class LikelyInconsistentApi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import androidx.annotation.FloatRange
import androidx.compose.runtime.Stable
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import com.huanshankeji.compose.ExperimentalApi
import com.huanshankeji.compose.LikelyInconsistentApi
import com.huanshankeji.compose.foundation.layout.ext.fillMaxHeightStretch
import com.huanshankeji.compose.foundation.layout.ext.fillMaxSizeStretch
import com.huanshankeji.compose.foundation.layout.ext.fillMaxWidthStretch
Expand Down Expand Up @@ -57,11 +59,17 @@ expect fun Modifier.fillMaxHeight(@FloatRange(from = 0.0, to = 1.0) fraction: Fl
@Stable
expect fun Modifier.fillMaxSize(@FloatRange(from = 0.0, to = 1.0) fraction: Float = 1f): Modifier

@ExperimentalApi
@LikelyInconsistentApi
@Stable
expect fun Modifier.wrapContentWidth(): Modifier

@ExperimentalApi
@LikelyInconsistentApi
@Stable
expect fun Modifier.wrapContentHeight(): Modifier

@ExperimentalApi
@LikelyInconsistentApi
@Stable
expect fun Modifier.wrapContentSize(): Modifier

0 comments on commit 1d1f9b1

Please sign in to comment.