feat: internal utils api

This commit is contained in:
2023-11-14 02:01:41 +08:00
parent 5ef9f21ef2
commit e6f1590bb1
2 changed files with 6 additions and 5 deletions

View File

@@ -27,8 +27,8 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.isSpecified
inline fun Dp.orElse() = if (isSpecified) this else null
internal inline fun Dp.orElse() = if (isSpecified) this else null
inline fun Color.orElse() = if (isSpecified) this else null
internal inline fun Color.orElse() = if (isSpecified) this else null
inline fun TextUnit.orElse() = if (isSpecified) this else null
internal inline fun TextUnit.orElse() = if (isSpecified) this else null

View File

@@ -33,7 +33,8 @@ import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.dp
@Stable
fun Modifier.status(enabled: Boolean) = if (enabled) this else alpha(0.5f)
internal fun Modifier.status(enabled: Boolean) = if (enabled) this else alpha(0.5f)
@Stable
fun Modifier.borderOrNot(border: BorderStroke, shape: Shape = RectangleShape) = border.takeIf { it.width > 0.dp }?.let { border(it, shape) } ?: this
internal fun Modifier.borderOrNot(border: BorderStroke, shape: Shape = RectangleShape) =
border.takeIf { it.width > 0.dp }?.let { border(it, shape) } ?: this