GraphicDataCardDefaults
public static class GraphicDataCardDefaults
Summary
Public fields |
|
|---|---|
static @NonNull GraphicDataCardDefaults |
Public methods |
|
|---|---|
final @NonNull LayoutElementBuilders.LayoutElement |
constructGraphic(Helper to construct a graphic content with a |
Public fields
Public methods
constructGraphic
public final @NonNull LayoutElementBuilders.LayoutElement constructGraphic(
@NonNull MaterialScope receiver,
@NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.Box> mainContent,
@NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.LayoutElement> iconContent,
float iconSizeRatio
)
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 | |
|---|---|
@NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.Box> mainContent |
The main content of the graphic slot. The main content is required to be wrapped in a |
@NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.LayoutElement> iconContent |
The icon to be placed at the center of the main content. It is highly recommended to provide it by calling |
float iconSizeRatio |
The ratio of the icon size to the |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
When the mainContent has size of |