object GraphicDataCardDefaults


Summary

Public functions

LayoutElementBuilders.LayoutElement
MaterialScope.constructGraphic(
    mainContent: MaterialScope.() -> LayoutElementBuilders.Box,
    iconContent: MaterialScope.() -> LayoutElementBuilders.LayoutElement,
    iconSizeRatio: Float
)

Helper to construct a graphic content with a mainContent and an iconContent in its center, that can be passed into the graphicDataCard.

Public functions

fun MaterialScope.constructGraphic(
    mainContent: MaterialScope.() -> LayoutElementBuilders.Box,
    iconContent: MaterialScope.() -> LayoutElementBuilders.LayoutElement,
    iconSizeRatio: Float = CENTER_ICON_SIZE_RATIO_IN_GRAPHIC
): LayoutElementBuilders.LayoutElement

Helper to construct a graphic content with a mainContent and an iconContent in its center, that can be passed into the graphicDataCard.

It is highly recommended for the mainContent to take a circularProgressIndicator or segmentedCircularProgressIndicator and keep its default size as expand in order to fill the available space for the best results across different screen sizes. To have contrasting content colors, when using this constructed graphic inside a graphicDataCard with one of the predefined colors in CardDefaults, it is also highly recommended to leave its ProgressIndicatorColors to default, which will automatically match to the card colors.

Parameters
mainContent: MaterialScope.() -> LayoutElementBuilders.Box

The main content of the graphic slot. The main content is required to be wrapped in a Box. This helper is specially designed to supports well with main content as circularProgressIndicator or segmentedCircularProgressIndicator to be placed in the graphics slot.

iconContent: MaterialScope.() -> LayoutElementBuilders.LayoutElement

The icon to be placed at the center of the main content. It is highly recommended to provide it by calling icon with only the resource ID, so that the returned layout would take advantage of the default styling functions provided by this helper, with equal width and height which are proportional to the mainContent's width , and matching color to the card.

iconSizeRatio: Float = CENTER_ICON_SIZE_RATIO_IN_GRAPHIC

The ratio of the icon size to the mainContent's width.

Throws
kotlin.IllegalArgumentException

When the mainContent has size of WrappedDimensionProp.