0

I want to build a recyclerView that will display Object of different types but the views are the same. Here's the class.

{
results: {
 clothing_items: [
  {
id: 422,
created_at: "2020-01-20 11:23:10 -0500",
image: "",
last_event_date: null,
name: "desk",
thumbnail: "",
type_of: "accessories"
 }
],
events: [
{
  id: 157,
  date: "2020-01-14 09:53:00 -0500",
  image: null,
  name: ""
 }
],
looks: [

],
 tags: [
  {
id: 97,
created_at: "2020-01-20 10:46:12 -0500",
title: "greatest person"
  }
]
 }
 }

The recycler view will contact all the ClothingItem, Event, Look, Tag. This response comes from global search. How to build the adapter? Should I use multiple adapter?

Dr4ke the b4dass
  • 1,184
  • 2
  • 17
  • 40
  • you can check this answer if you are looking for same it will help you https://stackoverflow.com/questions/42450466/two-arraylist-one-recyclerview-adapter – A.Gun Apr 28 '20 at 04:46
  • create custom class that contains all kind of object that you need. – Vishal Nagvadiya Apr 28 '20 at 05:01

0 Answers0