//tvlib/org.mjdev.tvlib.ui.components.complex/FocusableCard
[androidJvm]
fun FocusableCard(item: Any? = null, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Crop, scale: CardScale = CardDefaults.scale(), shape: CardShape = CardDefaults.shape(), textColor: Color = Color.White, textBackgroundUnselected: Color = Color.DarkGray.copy(alpha = 0.5f), textBackgroundSelected: Color = Color.Green.copy(alpha = 0.5f), colors: CardColors = CardDefaults.colors(), border: CardBorder = CardDefaults.colorFocusBorder(Color.Green), glow: CardGlow = CardDefaults.colorFocusGlow(Color.Green), showTitle: Boolean = true, placeholder: @Composable() -> Unit = {
Image(
painter = painterResource(R.drawable.broken_image),
contentDescription = "",
contentScale = contentScale
)
}, 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
)
}, focused: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = isEditMode(), focusRequester: [FocusRequester](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusRequester.html) = rememberFocusRequester(item), 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)
), 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, onFocusChange: (state: [FocusState](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusState.html)) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) = { state ->
if (state.isFocused || state.hasFocus) {
// todo focused from user ?
onFocus?.invoke(item, false)
}
}, titlePadding: [PaddingValues](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues.html) = PaddingValues(8.dp), cardWidth: [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.html) = computeCardWidth(), aspectRatio: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) = 16f / 9f, isEdit: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = isEditMode(), 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)