mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-07 19:14:12 +08:00
feat: internal utils api
This commit is contained in:
@@ -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
|
@@ -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
|
Reference in New Issue
Block a user