Hi, I am new here, and new to Anko. I have this `A...
# anko
s
Hi, I am new here, and new to Anko. I have this `AnkoComponent`:
Copy code
class ProjectCellView : AnkoComponent<ViewGroup> {
    var project: Project? = null

    override fun createView(ui: AnkoContext<ViewGroup>): View {
        return with(ui) {
            verticalLayout {
                textView {
                    text = project?.title
                }
            }
        }
    }
}
and my idea was to update its
project
in a adapter.onBindViewHolder so that it would show the correct title, but I use it in
createView
so that won´t work. What is the correct way to use a
AnkoComponent
in a RecyclerView adapter and bind its view's to data in the adapter.onBindViewHolder?
m
Just create views using reusable Anko context; bind them separately.