Android Question Huawei P20 and ExpandableCLV

Cableguy

Expert
Licensed User
Longtime 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"?
 

Peter Simpson

Expert
Licensed User
Longtime User
@hello @Cableguy,
I do find that my Huawei test devices including my Huawei Y6 2019 can be a bit laggy at times. The Y6 2019 is actually set to factory default and only has B4A-Bridge installed on it. But saying that, looking at the specs on your phone you should not gave any lag at all...
 
Upvote 0

sorex

Expert
Licensed User
Longtime 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

josejad

Expert
Licensed User
Longtime User
Maybe a good chance to test this:


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

josejad

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

 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I have juggled a bit with the creation of the views so the lag now is quite minimal and bearable. Thank for the inputs
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime 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
Longtime 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