Reputation: 1172
I have a simple listview, each item can be selected by a simple touch. All is very simple until now. But one of these items, somewhere in the list, on a touch, must show news items as a sublist and then a second touch on the same item must hide/collapse the sublist.
Like this :
After a touch on item3 :
It exists ExpandListView but I don't think that it could be ok here. Another way could be add/remove items from the ArrayList object and then call NotifyDataSetChanged, but it's not very fun. So, what is the best way to do that ?
Upvotes: 1
Views: 216
Reputation: 21
You should look Advanced RecyclerView library. You can find all combination of list view.
Upvotes: 0
Reputation: 1015
At least two ways
1) Add them to the touched view hierarchy on clicked and remove after second click
2) Add views to the xml, make VISIBILITY.GONE and change visibility on click events
Upvotes: 1