create

Java factory that returns a Builder capable of resolving *Res / *Attr resource IDs. Prefer this over new PrimitiveCard.Builder(content) when migrating from the legacy Card builder, since this preserves the same resource-aware ergonomics.


fun create(content: Component, cardBackgroundDrawable: Drawable?, cardBackgroundTransitionKey: String?, @ColorInt cardBackgroundColor: Int, cardBackgroundColorDv: DynamicValue<Int>?, @ColorInt clippingColor: Int, @ColorInt shadowStartColor: Int, @ColorInt shadowEndColor: Int, cornerRadiusDp: Float?, elevationDp: Float?, shadowTopOverridePx: Int?, shadowBottomOverridePx: Int?, shadowLeftOverridePx: Int?, shadowRightOverridePx: Int?, transparencyEnabled: Boolean, disableClipTopLeft: Boolean, disableClipTopRight: Boolean, disableClipBottomLeft: Boolean, disableClipBottomRight: Boolean, style: Style?): PrimitiveCard

Java-compatible full factory method that accepts Float/Int values for dimensions instead of Dimen inline class. Prefer using Builder instead for cleaner call sites.

Parameters

cornerRadiusDp

Corner radius in dp, or null to use default (2dp)

elevationDp

Elevation in dp, or null to use default (2dp)

shadowTopOverridePx

Override of shadow at top in pixels, or null for default

shadowBottomOverridePx

Override of shadow at bottom in pixels, or null for default

shadowLeftOverridePx

Override of shadow at left in pixels, or null for default

shadowRightOverridePx

Override of shadow at right in pixels, or null for default