How to unfold the selected cell and fold others
rmoustafa opened this issue · 2 comments
rmoustafa commented
Is there a way/method to unfold only the selected cell and fold the others ?
vikaskumark commented
cell.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
finalCell.toggle(false);
if (unfoldedIndexes.contains(lastItemPosition)) {
Log.v("LastItem", "LastItem" + lastItemPosition);
unfoldedIndexes.remove(lastItemPosition);
finalCell.fold(true);
notifyDataSetChanged();
}
lastItemPosition = position;
// register in adapter that state for selected cell is toggled
registerToggle(position);
}
});
cell is folding cell,lastItemPosition is previous clicked position
Testator commented
is registerToggle(position); the same as notifyItemChanged(position);
if not what is it?
thnx in advance