Android Question ClvExpanded with clv in second panel

ProjectGroup19

Active Member
Licensed User
Greetings Everyone!!

From this example,



I want to do something like this;

The Second panel contains a customlistview.

How do I add items to the customlistview for each row?


Thanks in advance.
 

Lucas Siqueira

Active Member
Licensed User
Longtime User


will add in the same way that you fill in the lblCategoryTitle fields ...
I always use VisibleRangeChanged in the clv

B4X:
Sub CustonListView1_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
    Dim ExtraSize As Int = 25 'Add 25 items at a time, this can be changed to suite your requirements
    For i = Max(0, FirstIndex - ExtraSize) To Min(LastIndex + ExtraSize, CLVList.Size - 1) 'Loop for adding/removing your items layout to or from the list
        Dim Pnl As B4XView = CLVList.GetPanel(i) 'Declare a new B4XView
        If i > FirstIndex - ExtraSize And i < LastIndex + ExtraSize Then 'Add a new item to the list
            If Pnl.NumberOfViews = 0 Then 'Add items to the list
                Pnl.LoadLayout("ItemInfo") ' you layout item
                lblCategoryTitle.Text = "CATEGORY"
                For i = 1 To 4
                     CustonListView2. AddTextItem("TESTE"&i,null)
                Next
            End If
        Else 'Remove items from the list
            If Pnl.NumberOfViews > 0 Then
                Pnl.RemoveAllViews 'Remove none visible item from the main xCLV layout
            End If
        End If
    Next
End Sub
 
Upvote 0

ProjectGroup19

Active Member
Licensed User
Thank you @Lucas Siqueira. I will give it a try.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…