1

I have implemented multiple view type recycler view but I want to implement single selection for each view type as shown in image below

MultipleviewSingleSelectionForEachType

abbasalid
  • 43
  • 14

1 Answers1

0

What you're looking for is a Heterogeneous list with(in your case) a header and list items.

This is very easy to implement with a recyclerview using a Heterogeneous adapter(this is now very easy with view holder pattern).

As far as the selection is concerned, what you can do is save the selection in the arraylist, if the size of the arraylist is zero, implement a onLongClickListener on the list item viewType, and if the size is greater than zero, then just implement a normal click listener, and on successive selection store each list object type in that arraylist.

Abhishek Tiwari
  • 936
  • 10
  • 25
  • I am able to display as show in image using multipleview type adapter but my problem is with selection I want to select only one From Blank(i) then another from Blank(ii) and so on so only 3 needs to be selected .I am having single arraylist in which all options and suboptions are present – abbasalid Dec 18 '17 at 05:56