I have a CustomListView populated with items. I would like to change the display height in the CustomListView when the item is clicked. Just to change the display height with existing controls in the item panel. Eg. I populate the list of items with 40dip height and I want to change the selected item height to display 100dip when its clicked. Any advice or suggestion on how can I do it? Thanks in advance.
1. Get the panel with clv.GetPanel.
2. Remove it from the list with clv.RemoveAt.
3. Insert it back to the list with the adjusted height by calling clv.InsertAt.
I tried that before and having below problem. What I need is to have expand and collapse function on the items to show extra contents for the items.
I was thinking on just change the CustomListView item height (as per remarked line) without remove and re-insert them.
Error occurred on line: 140 (CustomListView)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
B4X:
Sub clv_ItemClick (Index As Int, Value As Object)
ToastMessageShow("Item clicked = " & Index, False)
Dim p As Panel
p = clv.GetPanel(Index)
clv.RemoveAt(Index)
clv.InsertAt(Index, p, 80dip, Value)
' clv.GetPanel(Index).GetView(0).Height = 80dip
clvIndex = Index
End Sub