Android Question Huawei P20 and ExpandableCLV

Cableguy

Expert
Licensed User
Hi guys,

It's been a while… trying to pass the time in these troublesome times, I decided to restart a few projects, and got back into development.
I have an Huawei P20 and a very simple layout consisting of a "Title" panel (with a label, a textfield, 2 checkboxes and a button) and a ExtendableCLV.
For now I am populating with "only" 288 items. each Item's layout is exactly the same and are set in the layout, so they are static, except for 12 labels in each item.

I am getting a lag everytime I reload/recreate the CLV of about 2/3 seconds... is this considered "normal"?
 

sorex

Expert
Licensed User
it seems that you're creating a few thousands of views at once?

then it's normal that it will lag.

try adding them while you scroll through them.
 
Upvote 0

José J. Aguilar

Expert
Licensed User
Maybe a good chance to test this:


BTW @Cableguy we've miss you. I hope everything is fine
 
Upvote 0

José J. Aguilar

Expert
Licensed User
And of course, perfect chance to see the brilliant new Peter Simpson's Tutorials

 
Upvote 0

Cableguy

Expert
Licensed User
And of course, perfect chance to see the brilliant new Peter Simpson's Tutorials

Thanks, @José J. Aguilar , I will check them out.
For now all is well, doing the confinement adds a very special layer of stress... Not used to.
 
Upvote 0

beltrao73

Member
Licensed User
Hi Erel,

I teste your example with a loop of 3000 itens, and it took a while to load, probably becuse of the CreateItem call inside the For Loop.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    expandable.Initialize(clv1)
    For i = 1 To 3000
        Dim clr As Int = Rnd(0xFF000000, 0xFFFFFFFF)
        Dim p As B4XView = CreateItem(clr, "Item #" & i, Rnd(100dip, 300dip) + 60dip)
        clv1.Add(p, expandable.CreateValue(p, clr))
    Next
End Sub

Could it be moved to then clv1_VisibleRangeChanged Sub?
 
Upvote 0
Top