airbnb / epoxy

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

Glide Preloading support with Databinding #780

Open ovUdemy opened 5 years ago

ovUdemy commented 5 years ago

Looking over the image preloading documentation https://github.com/airbnb/epoxy/wiki/Image-Preloading there doesn't appear to be anything related to data binding. Was this not added or is there no support for data binding and we would have to use @ModelView or an EpoxyHolder?

elihart commented 5 years ago

Databinding is supported - but it doesn't require anything different. In your preloader setup you would use the databinding generated EpoxyModel to specify how to load the image request, and specify the imageview id that the request is loaded in to.

I suggested looking through the source code

tykimseoul commented 4 years ago

Having a similar question here.

I have checked both the wiki and the sample code. But how do I retrieve the id of the ImageView to load the image into? The provided sample code stores the reference to the ImageView in the EpoxyModel class but with databinding such class is generated. I'm looking for something like requestManager.load(image).into(imageView) but not sure what to put for imageView.

Thanks in advance