Android - in concat adapter how to wrap items of one adapter with rounded corners background

16 views Asked by At

I have a view, in which I need to present scrollable content. Content consists of some headers and then actual data. Because I need it to be high-performance, I cannot put headers and recycler into a nestedscrollview separately, so that all content scrolls, but the recycler contains one item type only. I need to have all the data in one recycler, either using Concat Adapter (preferred option) or possibly one adapter with different view types.

I created a concat adapter with 3 adapters for different view types: red, blue and green. Now, I need to wrap all items of type green with a rounded-corners background.

Is this possible? The only thing I can think of is to make some item decorator for type green items, where first and last items would have different decorators, but it seems to be too complicated a solution for a seemingly simple ux problem.

Here's a sketch of what I want to achieve:

enter image description here

0

There are 0 answers