| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /*
- * Copyright (c) Milan Jurkulák 2024.
- * Contact:
- * e: mimoccc@gmail.com
- * e: mj@mjdev.org
- * w: https://mjdev.org
- */
- package eu.mjdev.desktop.components.card
- import androidx.compose.desktop.ui.tooling.preview.Preview
- import androidx.compose.foundation.interaction.MutableInteractionSource
- import androidx.compose.foundation.layout.*
- import androidx.compose.runtime.Composable
- import androidx.compose.ui.Modifier
- import eu.mjdev.desktop.components.card.base.*
- @Suppress("unused")
- @Composable
- fun ClassicCard(
- onClick: () -> Unit = {},
- image: @Composable BoxScope.() -> Unit = {},
- title: @Composable () -> Unit = {},
- modifier: Modifier = Modifier,
- onLongClick: (() -> Unit)? = null,
- subtitle: @Composable () -> Unit = {},
- description: @Composable () -> Unit = {},
- shape: CardShape = CardDefaults.shape(),
- colors: CardColors = CardDefaults.colors(),
- scale: CardScale = CardDefaults.scale(),
- border: CardBorder = CardDefaults.border(),
- glow: CardGlow = CardDefaults.glow(),
- contentPadding: PaddingValues = PaddingValues(),
- interactionSource: MutableInteractionSource? = null
- ) = Card(
- onClick = onClick,
- onLongClick = onLongClick,
- modifier = modifier,
- interactionSource = interactionSource,
- shape = shape,
- colors = colors,
- scale = scale,
- border = border,
- glow = glow
- ) {
- Column(modifier = Modifier.padding(contentPadding)) {
- Box(contentAlignment = CardDefaults.ContentImageAlignment, content = image)
- Column { CardContent(title = title, subtitle = subtitle, description = description) }
- }
- }
- @Preview
- @Composable
- fun ClassicCardPreview() = ClassicCard()
|