Closed onlymnsh closed 7 years ago
Hi,
You have to pass one list to the adapter. For instance, you have lists like below;
List<YourModel> yourList
List<YourSecondModel> yourSecondList
List<YourThirdModel> yourThirdList
You have to add all of them to an object list like below;
List<Object> yourObjectList
yourObjectList.addAll(yourList);
yourObjectList.addAll(yourSecondList);
yourObjectList.addAll(yourThirdList);
now you can pass your objectList to the adapter. Positioning depends on the objectlists' positions.
Hi, Its working as u said. Could you please tell me how to switch to alternate viewtype and highlight the selected row like single selected item.
Thanks
All of those things just like the recyclerview. For highlighting the selected row; you can make itemview selected in your viewholder.
If you want to add new features besides above to the GenericRecyclerAdapter class, you can extend it or you can add some feature to this library and create a pull request.
I Use this way to show multiple layout.
mAdapter = new GenericAdapterBuilder() .addModel( R.layout.contact_row, YourViewHolder.class, YourModel.class) .addModel( R.layout.second_row, YourSecondViewHolder.class, YourSecondModel.class) .addModel( R.layout.third_row, YourThirdViewHolder.class, YourThirdModel.class) .execute();
where i put condition which layout inflate at what position?