Android Tutorial Expandable list based on CustomListView

Status
Not open for further replies.
A cross platform version is available here: https://www.b4x.com/android/forum/t...g-or-collapsing-xcustomlistview-items.106148/

expander.gif



This example uses a slightly modified version of CustomListView to create an expandable list.

Each item in the list is made of two panels. One for the title with the arrow and the other is the expanded panel.
Note that the expanded items height can be different for different items.

The example depends on AnimationPlus and StringUtils libraries.
 
Last edited:

mohsen m

New Member
This code will collapse open items before a new one is expanded:
B4X:
Sub ExpandItem (index As Int)
   For i = 0 To clv1.GetSize - 1
     Dim p As Panel = clv1.GetPanel(i)
     If p.Tag = True Then CollapseItem(i)
   Next
   clv1.ResizeItem(index, ExpandedHeight)
   clv1.GetPanel(index).Tag = True
   AnimatedArrow(index, 0, 180)
End Sub
Not work
 
Status
Not open for further replies.
Top