Android Question ExpandedListView deprecated

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello All,
I am still using the old ExpandedListView Class module.
Is there any library that does the same thing ?
I need the expand and collapse of main panels, that show inside child views.

Thanks in advance
 

josejad

Expert
Licensed User
Longtime User
Hi:

Not sure which one you're using. This is the recommended one. Be sure you're using the xCustomListView internal library

 
Upvote 1

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hi:

Not sure which one you're using. This is the recommended one. Be sure you're using the xCustomListView internal library

I am not using the Library, but the class module (ExpandedListView), But I will surely take a look at that method. Thanks.
 
Upvote 0

Pedro Caldeira

Active Member
Licensed User
Longtime User
I am now using the xCustomListView and the class ExpandedListView, that states in the top of the code

B4X:
'xCustomListView v1.65 - modified version to support expandable items
As we now have the version 1.73 of the xCustomListView, its all good., I think.

I am readjusting some code that I have inherited and need to get the full height of the contents of the expandable panels so I can resize them accordingly, after they are populated by their inner child views.

I have a ExpandedListView with several collapsable panels and each of them with several views, crated by the user dynamically. I need a method to recalculate the ExpandedHeight of that panel, so all inner items show when expanded. Any ideas?

I tried the approach below, and it works, but somebody may have a more efficient method.
I created a new property, AutoExpanded as a Boolean variable, and changed the default Expanded Sub.


B4X:
Sub ExpandItem(index As Int)
    Dim InnerReference As ExpandedListView = Me
    Dim id As ItemData = InnerReference.GetValue(index)
    If isAutoExpanded Then
        Try
            Dim cPanel As B4XView = InnerReference.GetPanel(index)
            Dim TitlePanel As Panel = cPanel.GetView(0)
            Dim ExpandablePanel As Panel = cPanel.GetView(1)
            Dim AutoExpandableHeight As Int = 0
            For x=0 To ExpandablePanel.NumberOfViews -1
                AutoExpandableHeight = AutoExpandableHeight + ExpandablePanel.GetView(x).Height
            Next
            AutoExpandableHeight = AutoExpandableHeight + TitlePanel.Height
            InnerReference.ResizeItem(index, AutoExpandableHeight)
        Catch
            InnerReference.ResizeItem(index, id.ExpandedHeight)
        End Try
    Else
        InnerReference.ResizeItem(index, id.ExpandedHeight)
    End If

    InnerReference.GetPanel(index).Tag = True
    If (mUpDownIconExists) Then
        AnimatedArrow(index, 0, 180)
    End If
End Sub
 
Last edited:
Upvote 0
Top