DpadComposeFocusViewHolder
class DpadComposeFocusViewHolder<T>(parent: ViewGroup, isFocusable: Boolean = true, content: @Composable (item: T) -> Unit? = null) : RecyclerView.ViewHolder
This allows inline definition of ViewHolders in onCreateViewHolder:
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DpadComposeFocusViewHolder<Int> {
return DpadComposeFocusViewHolder(parent) { item ->
ItemComposable(item)
}
}Content copied to clipboard
To update the current item, override onBindViewHolder and call setItemState:
override fun onBindViewHolder(holder: DpadComposeFocusViewHolder<Int>, position: Int) {
holder.setItemState(getItem(position))
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(parent: ViewGroup, isFocusable: Boolean = true, content: @Composable (item: T) -> Unit? = null)
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Sets the content of the internal ComposeView
Link copied to clipboard
Marks the internal ComposeView has focusable or not. If false, this will prevent child nodes from being focusable
Link copied to clipboard
Link copied to clipboard
Updates the current item so that the composition is updated with the new value in content