Skip to content

item card

milan jurkulák edited this page May 2, 2024 · 1 revision

//tvlib/org.mjdev.tvlib.ui.components.card/ItemCard

ItemCard

[androidJvm]\

@Composable

fun ItemCard(item: Any? = null, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Crop, scale: CardScale = CardDefaults.scale(), shape: CardShape = CardDefaults.shape(), textColor: Color = Color.White, colors: CardColors = CardDefaults.colors(), border: CardBorder = CardDefaults.colorFocusBorder(Color.Green), glow: CardGlow = CardDefaults.colorFocusGlow(Color.Green), aspectRatio: Float = 16f / 9f, placeholder: @Composable() -> Unit = { Image( painter = painterResource(R.drawable.broken_image), "", modifier ) }, imageRenderer: @Composable() -> Unit = { ImageAny( modifier = modifier.fillMaxSize(), src = (item as? ItemWithImage<>)?.image, contentDescription = (item as? ItemWithDescription<>)?.description?.toString(), contentScale = contentScale, placeholder = placeholder ) }, cardWidth: Dp = computeCardWidth(), focused: Boolean = isEditMode(), focusState: MutableState<FocusState> = rememberFocusState( item, FocusHelper(focused) ), focusRequester: FocusRequester = rememberFocusRequester(item), titlePadding: PaddingValues = PaddingValues(8.dp), showTitle: Boolean = true, onFocus: (item: Any?, fromUser: Boolean) -> Unit? = null, onClick: (item: Any?) -> Unit? = null)

Clone this wiki locally