0

enter image description hereI need to show/hide four textviews on pressing four buttons. The functionality is visible in pictures. In iOS I used button. But for android,can I use some sort of list view or something else suitable to thisenter image description here? !First and second buttons are pressed here while third and fourth are not yet. Again pressing the button that is already pressed,text hides]1

Ali Hassan
  • 519
  • 6
  • 26

2 Answers2

3

You can use ExpandableListView.

Using ExpandableListView, you can have groups and childs, and you can expand and collapse any groups you want.

For example:

mExpandableListView.expandGroup(groupPosition);
mExpandableListView.collapseGroup(groupPosition);
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
1

These is a very good example on Custom ExpandibleList in Github.

https://github.com/tjerkw/Android-SlideExpandableListView

Hope this will help you to achieve smooth animation and collapse.

You need to change the layout as your requirement.

Hope this will help you.

Amit Gupta
  • 8,914
  • 1
  • 25
  • 33