Hi all,
Based on Erel's library: https://www.b4x.com/android/forum/t...g-or-collapsing-xcustomlistview-items.106148/
How would the code be changed to: when selecting another item, the currently expanded item would close?
Take a look at Androids Contacts app to see what I mean.
I have tried this in the Main activity:
Now in the clv1_ItemClick event handler:
Problem: touching an item for the first time, expands it. Touching the same item again, collapses it, but touching the same item again, does not expand it.
I've searched the forum for a solution, but nothing.
Anyone know how this should work?
Thanx,
Mark Stuart
Based on Erel's library: https://www.b4x.com/android/forum/t...g-or-collapsing-xcustomlistview-items.106148/
How would the code be changed to: when selecting another item, the currently expanded item would close?
Take a look at Androids Contacts app to see what I mean.
I have tried this in the Main activity:
B4X:
Sub Globals
Private clv1 As CustomListView
Private lblTitle As B4XView
Private pnlTitle As B4XView
Private pnlExpanded As B4XView
Private xui As XUI
Private expandable As CLVExpandable
Private prevIndex As Int '<== added this
End Sub
Now in the clv1_ItemClick event handler:
B4X:
Sub clv1_ItemClick(Index As Int, Value As Object)
If prevIndex >= 0 Then
expandable.CollapseItem(prevIndex)
End If
expandable.ExpandItem(Index)
prevIndex = Index
End Sub
Problem: touching an item for the first time, expands it. Touching the same item again, collapses it, but touching the same item again, does not expand it.
I've searched the forum for a solution, but nothing.
Anyone know how this should work?
Thanx,
Mark Stuart