Created
January 21, 2021 23:12
-
-
Save drawers/409a59638d40a1edc4b02b8fdd3dc763 to your computer and use it in GitHub Desktop.
DomainLeakingIntoPresentation.kt
This file contains 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
class TasksFragment { | |
private lateinit var tasksAdapter: TasksAdapter | |
fun showTasks(tasks: List<Tasks>) { | |
tasksAdapter.setData(tasks) | |
} | |
} | |
// inside tasks adapter | |
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | |
fun bindTo(task: Task) { | |
if (task.isComplete) { | |
itemView.textView.setColor(R.color.red) | |
} else { | |
itemView.textView.setColor(R.color.blue) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment