Created
April 3, 2021 04:01
-
-
Save manavtamboli/a539d841064058328561f65a037a5456 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
| // ToDoItem -> Data Class to hold item data | |
| // ToDoDiff -> Diff Object for ToDoItem Class | |
| class TodoAdapter : AdapterX<TodoItem>(R.layout.item_todo, ToDoDiff){ | |
| override fun ViewHolder.onBind(item: TodoItem) { | |
| val todoNameTextView : TextView = itemView.findViewById(R.id.todo_name) | |
| val isCompleted : CheckBox = itemView.findViewById(R.id.todo_completed) | |
| todoNameTextView.text = item.name | |
| isCompleted.isChecked = item.isCompleted | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment