Created
May 31, 2022 19:09
-
-
Save Raiden18/6d535f35a3a8073392968397e7e4e658 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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