philipplackner / TodoList

102 stars 92 forks source link

binding issue #4

Open Gk160 opened 2 years ago

Gk160 commented 2 years ago

override fun onBindViewHolder(holder: ToDoViewHolder, position: Int) { val curToDo = todos[position] holder.itemView.apply { tvTodoTitle.text = curToDo.Title cbDone.isChecked = curToDo.isChecked toggleStrikeThrough(tvTodoTitle, curToDo.isChecked) cbDone.setOnCheckedChangeListener { _, isChecked -> toggleStrikeThrough(tvTodoTitle, isChecked) curToDo.isChecked = !curToDo.isChecked } }