B4J Question ListSelectionView takes long time to load

le_toubib

Active Member
Licensed User
Longtime User
hi all
i'm loading a layout containing a ListSelectionView ...
in some devices it loads immediately , on other devices it takes up to 40 seconds to load .. (with the same list size and comparable hardware)
the problem is that the whole interface hangs while loading.
i cant find a patern of difference between both cases .. is there a dependency or setting that i'm missing ?
 

le_toubib

Active Member
Licensed User
Longtime User
listselectionview is a custom view a part of the controlsfx library ..
B4X:
Sub InitializeTheTwins
    timer("start twins")
    pnlTwin1.LoadLayout("LO_twin")
    btnok.Enabled=True
    btncancel.Enabled=True
    timer("end twins")
End Sub
this sub takes 42000+ ms to execute on some devices (hanging the whole UI untill it ends) , and 200+ ms on other devices .
p.s : if i do pnlTwin1.removeallnodes , and then re execute the same sub it will take 27+ ms , even if on the slow devices ..
is there a way to fix this ? or at least let it load in the background without hanging the UI ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
In retrospect I wouldn't have wrapped ControlsFX. There are major implementation mistakes inside the library. For example, it can download FontAwesome on the main thread in some situations. Things that never happen in B4X code.
I wasn't aware to these issues when I wrapped it.

This might be the reason for the slowness you see. My recommendation is to remove the library and implement a similar control yourself. It shouldn't be too difficult to create one based on two CustomListViews.
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
In retrospect I wouldn't have wrapped ControlsFX. There are major implementation mistakes inside the library. For example, it can download FontAwesome on the main thread in some situations. Things that never happen in B4X code.
I wasn't aware to these issues when I wrapped it.

This might be the reason for the slowness you see. My recommendation is to remove the library and implement a similar control yourself. It shouldn't be too difficult to create one based on two CustomListViews.
Thanks erel , the list selection view is extremely useful to my purpose ,
is it possible to eliminate the font awesome from the library ?
I will try to create a similar one .. is there anything similar already there ??
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
is it possible to eliminate the font awesome from the library ?
1. I'm not sure that this is the case here, though it is probable.
2. It happens inside ControlsFX code. It is an open source project, so it is possible to modify it, however I don't plan to further update this library.
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
1. I'm not sure that this is the case here, though it is probable.
2. It happens inside ControlsFX code. It is an open source project, so it is possible to modify it, however I don't plan to further update this library.
thanks again,
i had to do a replacement for listselection view , segmented buttons , and used jcustomtoast ,
that solved the problem of slowing , and saved 1mb from the jar size šŸ‘
 
Upvote 0
Top