Skip to content

Instantly share code, notes, and snippets.

@Raiden18
Created May 31, 2022 19:09
Show Gist options
  • Save Raiden18/6d535f35a3a8073392968397e7e4e658 to your computer and use it in GitHub Desktop.
Save Raiden18/6d535f35a3a8073392968397e7e4e658 to your computer and use it in GitHub Desktop.
data class YourUiModel(
val title: String,
val description: String,
val visibility: Int // View.GONE, etc
)
class YourViewHolder(
view: View
): RecyclerView.ViewHolder(view) {
//...
fun bind(yourUiModel: YourUiModel) {
titleView.text = yourUiModel.title
descriptionView.text = yourUiModel.description
someView.visibility = yourUiModel.visibility
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment