Android – в адаптере concat как обернуть элементы одного адаптера фоном с закругленными угламиAndroid

Форум для тех, кто программирует под Android
Ответить
Гость
 Android – в адаптере concat как обернуть элементы одного адаптера фоном с закругленными углами

Сообщение Гость »


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:


Изображение



Источник: https://stackoverflow.com/questions/781 ... ded-corner
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»