0

enter image description here

enter image description here

(RedBox is MainItem, Blue Box is SubItem)

I want to list another RecyclerView item(Sub Item) inside a RecyclerView item(Main Item) as shown in the picture.

In fact, this has already been implemented. I implemented it by using SubAdapter in onBindViewHolder of Main Adapter.

However, since it is an Adapter in an Adapter, I decided that it was complicated. I found out about ConcatAdapter and tried to use it.

However, at least as far as I know, it seems that only one RecyclerView Layout can be expressed when using ConcatAdapter.

Is there a way to apply each of the two RecyclerView Layouts when using ConcatAdapter?

Zain
  • 37,492
  • 7
  • 60
  • 84
ybybyb
  • 1,385
  • 1
  • 12
  • 33
  • 1
    Are you implementing a recyclerview into another ? – Karunesh Palekar Sep 16 '21 at 20:12
  • I'm sorry, but I didn't understand exactly what you mean. – ybybyb Sep 16 '21 at 20:15
  • 1
    Are you trying to make one recylerview inside of another recyclerview ? Or both are separate and you want them one beside another ? – Karunesh Palekar Sep 16 '21 at 20:16
  • In terms of UI, I'm trying to implement one Recyclerview insedie of another RecyclerView. As the 'OP' also mentioned, I already implemented this. Put another adapter in one adapter. But I think this method is too complicated, so I'm looking for another way – ybybyb Sep 16 '21 at 20:23
  • 1
    `ConcatAdapter` is for **one** `RecyclerView` and possible multiple adapters for **one** `RecyclerView`, so you can achieve by **one** `RecyclerView`. What is difference position `Blue Box` below `Red Box` and `Blue Box` inner below `Red Box`? – liveAnyway Sep 17 '21 at 04:12
  • @liveAnyway thanks. The `red box` represents the `items` in the `Main Recyclerview`, and the `blue box` represents the `items` in the `nested recyclerview` inside it. The `second image` shows the implementation of the `first image`. – ybybyb Sep 17 '21 at 17:45

0 Answers0