airbnb / epoxy

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

Dynamic view update in epoxy through data binding approch #1360

Open ranjeetscience opened 1 year ago

ranjeetscience commented 1 year ago

Hi, We are using epoxy library in our app for our SDUI usecase with data binding approach. The problem is , our UI is too much stateful, means bases on some user action we have to update the ui a lot.

Example, we used camera scanner to scan qr code, once user scan the qr we have to update our already inflated epoxy view with scanned value at some particular position. Other example is that , based on some server condition we have to make view visible or gone which is also dynamic. Similar issue happen for edit text and edit text change listener if we have to update view based on what user is typing

The problem is that simply changing that data class value and updating the adapter does not do anything and in most of the cases it crashes(Epoxy attribute fields on a model cannot be changed once .....)

I went to lot of open/closed issue , docs and blog and most of the places it mentioned we have to immutable data class only and if required we should use copy method. But for us it view state is getting updated at too many places and doing this make code really unreadable. Can you help with this?