I have a RecyclerCollectionComponent
where I am providing data using DataDiffSection
. Now I want to have some margin (say x dp) for the first and last item and some margin among items (say y dp).
My onRender Looks like this:
@OnEvent(RenderEvent::class)
fun onRender(
c: ComponentContext,
@FromEvent model: SomeObject): RenderInfo {
return ComponentRenderInfo.create()
.component(MyAwesomeCoomponent
.create(c)
.someParam(param)
.build())
.build()
}
This just creates a list of items placed side by side. If I include margin in this Component, it will give the same margin to all items, whereas I want (x dp) margins for the first and last item, and (y dp) margin among intermediate items.
Is there some way, I could get position of item in onRender event handler?