-2

How to design this? I need one recyclerview with 3 different styled cardview in navigation activity.

Image

halfer
  • 19,824
  • 17
  • 99
  • 186
Megha Jain
  • 21
  • 1
  • 4

1 Answers1

0

Ok, since you haven't provided any code or what you have done so far. I will give you a gist on how to achieve this.

First you need to understand how RecyclerView works with ViewHolder pattern. Next, each CardView item is populated using a custom adapter which I believe you have already done that.

In the custom adapter you should do something in this method

@Override
    public int getItemViewType(int position) {
        // TODO Auto-generated method stub
}

this method is very important if you are doing different layouts for different positions.

Also refer to this answer for more information. https://stackoverflow.com/a/26245463/6142219

This should get you started. Let me know if you get stuck somewhere

Deepak kaku
  • 1,218
  • 9
  • 15