idanatz / OneAdapter

A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
MIT License
470 stars 45 forks source link

Get item position from item module #17

Closed meruiden closed 4 years ago

meruiden commented 4 years ago

its not possible to make a layout where you have a list where every 1 item it has a darker background

It would be nice if I could get the item position from the ItemModule so that it would simple be:

val darkBackground = position % 2 == 1

from the onBind function

idanatz commented 4 years ago

Will add this data in the next version of the library

idanatz commented 4 years ago

Version 1.5.0 is out with this ability. Please notice that there are breaking changes in the modules API due to this request. The sample project is updated as well for reference.