CardLayoutDefaults


@ExperimentalTvMaterial3Api
object CardLayoutDefaults


Summary

Public functions

Unit
@Composable
ImageCard(
    onClick: () -> Unit,
    interactionSource: MutableInteractionSource,
    modifier: Modifier,
    onLongClick: (() -> Unit)?,
    shape: CardShape,
    colors: CardColors,
    scale: CardScale,
    border: CardBorder,
    glow: CardGlow,
    content: @Composable () -> Unit
)

ImageCard is basically a Card composable with an image as the content.

CardLayoutColors
@Composable
contentColor(
    contentColor: Color,
    focusedContentColor: Color,
    pressedContentColor: Color
)

Creates CardLayoutColors that represents the default content colors used in a CardLayout.

Public functions

ImageCard

Added in 1.0.0-alpha10
@Composable
fun ImageCard(
    onClick: () -> Unit,
    interactionSource: MutableInteractionSource,
    modifier: Modifier = Modifier,
    onLongClick: (() -> Unit)? = null,
    shape: CardShape = CardDefaults.shape(),
    colors: CardColors = CardDefaults.colors(),
    scale: CardScale = CardDefaults.scale(),
    border: CardBorder = CardDefaults.border(),
    glow: CardGlow = CardDefaults.glow(),
    content: @Composable () -> Unit
): Unit

ImageCard is basically a Card composable with an image as the content. It is recommended to be used with the different CardLayout(s).

This Card handles click events, calling its onClick lambda.

Parameters
onClick: () -> Unit

called when this card is clicked.

interactionSource: MutableInteractionSource

the MutableInteractionSource representing the stream of Interactions for this card. When using with the CardLayout(s), it is recommended to pass in the interaction state obtained from the parent lambda.

modifier: Modifier = Modifier

the Modifier to be applied to this card.

onLongClick: (() -> Unit)? = null

called when this card is long clicked (long-pressed).

shape: CardShape = CardDefaults.shape()

CardShape defines the shape of this card's container in different interaction states. See CardDefaults.shape.

colors: CardColors = CardDefaults.colors()

CardColors defines the background & content colors used in this card for different interaction states. See CardDefaults.colors.

scale: CardScale = CardDefaults.scale()

CardScale defines size of the card relative to its original size for different interaction states. See CardDefaults.scale.

border: CardBorder = CardDefaults.border()

CardBorder defines a border around the card for different interaction states. See CardDefaults.border.

glow: CardGlow = CardDefaults.glow()

CardGlow defines a shadow to be shown behind the card for different interaction states. See CardDefaults.glow.

content: @Composable () -> Unit

defines the image content Composable to be displayed inside the Card.

contentColor

@Composable
fun contentColor(
    contentColor: Color = MaterialTheme.colorScheme.onSurface,
    focusedContentColor: Color = contentColor,
    pressedContentColor: Color = focusedContentColor
): CardLayoutColors

Creates CardLayoutColors that represents the default content colors used in a CardLayout.

Parameters
contentColor: Color = MaterialTheme.colorScheme.onSurface

the default content color of this CardLayout.

focusedContentColor: Color = contentColor

the content color of this CardLayout when focused.

pressedContentColor: Color = focusedContentColor

the content color of this CardLayout when pressed.