airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.52k stars 726 forks source link

Recommended way to setup click listeners with databinding #823

Open ColtonIdle opened 5 years ago

ColtonIdle commented 5 years ago

I was wondering if Epoxy maintainers or community had any advice on setting up a click listener when I'm using databinding with Automatic Model Generation.

elihart commented 5 years ago

We don't use databinding internally at airbnb so I don't have any real production experience using it (besides building out the system a long time ago :P )

So beyond the basics I don't have any recommended best practices myself, maybe external people do though.

I'm not exactly sure what you're asking though. Don't you just make a data variable for a click listener in your xml, set that on your view, and get a setter generated on the model?

ColtonIdle commented 5 years ago

There were some scary warning in the documentation about DoNotHash and onClickListeners but it wasn't clear to me if I should be doing something different than what you just described. 😄