If you need a lot of logic to bind your view holde...
# android
p
If you need a lot of logic to bind your view holder, where do people usually put it?
d
in presenter i guess
btw, what kind of logic do you mean?
p
Like, for instance I want to ellipsis text if it's more than 500 characters, and check what the time before printing a date, so I can format it better. My viewholder just seems to be getting longer and longer
a
I’d consider preparing the data once, instead of computing it every time for every item during bind, making the binding simple again
p
Interesting... Like if it was ellipsising the text would I put the whole array through a function that checked for textsize etc..
d
formatting date and ellipsising text is a view logic you can keep it in a viewholder, just avoid heavy computating operations in bind method as @arekolek mentioned
p
👍 Thank you