android recyclerview, there is a list of n-elements, by clicking on the last item, the previous items (gone) are hidden, I can delete the elements from the arrayList and update the adapter, but I can hide and show these items again, How to implement it?

    1 answer 1

    In general, to do so is a bad idea, as for me. But who am I to judge? Why not show this item in a new window? But if the problem is this - the simplest solution would be to replace adapters. Create one adapter with a list of n elements and the other adapter whose list is empty. When you click on some element, add it to the sheet of the second adapter, set the adapter to the recycler, ready. After clicking on this item, set the main adapter back to the recycler, clean the list with one item. Such manipulations can even be done with animations, it may turn out well ...