-item-card.md 3.7 KB

//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](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html)() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) = {
    ImageAny(
        modifier = modifier.fillMaxSize(),
        src = (item as? ItemWithImage<*>)?.image,
        contentDescription = (item as? ItemWithDescription<*>)?.description?.toString(),
        contentScale = contentScale,
        placeholder = placeholder
    )
}, cardWidth: [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.html) = computeCardWidth(), focused: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = isEditMode(), focusState: [MutableState](https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState.html)<[FocusState](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusState.html)> = rememberFocusState(
    item,
    FocusHelper(focused)
), focusRequester: [FocusRequester](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusRequester.html) = rememberFocusRequester(item), titlePadding: [PaddingValues](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues.html) = PaddingValues(8.dp), showTitle: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true, onFocus: (item: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?, fromUser: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? = null, onClick: (item: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? = null)