I need to make an expandable RecyclerView
, with only one opened item per click (all others must close).
I know there is possibility to do this with the help of ExpandableListView
and then use next code:
elv.setOnGroupExpandListener(new OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
if (lastExpandedPosition != -1
&& groupPosition != lastExpandedPosition) {
elv.collapseGroup(lastExpandedPosition);
}
lastExpandedPosition = groupPosition;
}
});
but is there the way to make the same with using RecyclerView
?