How to design this? I need one recyclerview with 3 different styled cardview in navigation activity.
Asked
Active
Viewed 35 times
-2
-
What have you tried so far? – Md Sufi Khan May 04 '18 at 20:06
-
I have tried recycler view with card view but did not work – Megha Jain May 04 '18 at 20:15
-
Share your adapter code. – Md Sufi Khan May 04 '18 at 20:24
1 Answers
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