0

I have no idea how to make this work. Whether to make an custom arrayadapter or something else. It seems really simple to do. For each individual, just specify the number of attributes?

For example, I make a RecycleView array of pet owners. I click on one of these people to see how many pets / children / cars they have has:

This is a mockup of what I'm trying to say.

So for other people, it may go like...

  • Chris has 3 pets, 1 kid, 1 car
  • Bobby has 0 pets, 0 kids, 1 car
  • Person 3 has 6 pets, 5 kids, 2 cars
jpf
  • 173
  • 2
  • 13
  • To create a row of icons programmatically you could use a LinearLayout with horizontal orientation and use the add() method to add imageviews – Alexandre Martin Jun 12 '16 at 15:31

1 Answers1

2

You can use LinearLayoutManager.HORIZONTAL recyclerview for add image dynamically.

LinearLayoutManager layoutManager= new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, false);
mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
mRecyclerView.setLayoutManager(layoutManager);

just include in your item and adapter