-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Create the following function:
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.DefaultGroupName
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Dp
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
inline fun buildImageVector(
name: String = DefaultGroupName,
defaultWidth: Dp,
defaultHeight: Dp,
viewportWidth: Float,
viewportHeight: Float,
tintColor: Color = Color.Unspecified,
tintBlendMode: BlendMode = BlendMode.SrcIn,
autoMirror: Boolean = false,
builderAction: ImageVector.Builder.() -> Unit
): ImageVector {
contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }
return ImageVector.Builder(
name, defaultWidth, defaultHeight,
viewportWidth, viewportHeight,
tintColor, tintBlendMode, autoMirror
).apply(builderAction).build()
}Using this function in ImageVector will cause the preview to fail:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
