Package-level declarations

Types

Link copied to clipboard
class DpadComposeFocusViewHolder<T>(parent: ViewGroup, isFocusable: Boolean = true, content: @Composable (item: T) -> Unit? = null) : RecyclerView.ViewHolder

This allows inline definition of ViewHolders in onCreateViewHolder:

Link copied to clipboard
class DpadComposeViewHolder<T>(parent: ViewGroup, onClick: (item: T) -> Unit? = null, onLongClick: (item: T) -> Boolean? = null, isFocusable: Boolean = true, content: @Composable (item: T, isFocused: Boolean) -> Unit = { _, _ -> }) : RecyclerView.ViewHolder

A basic ViewHolder that forwards content to a ComposeView and handles focus and clicks inside the View system.

Functions

Link copied to clipboard
fun Modifier.dpadClickable(enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onLongClick: () -> Unit? = null, onClick: () -> Unit?): Modifier

Similar to Modifier.clickable, but handles only AcceptableKeys and triggers a sound effect on click. Workaround for: https://issuetracker.google.com/issues/268268856