Android Question PreoptimizedCLV with CLVIndexScroller

asales

Expert
Licensed User
Longtime User
I tried to use the PreoptimizedCLV with the CLVIndexScroller class.
With customlistview works fine, but when I add the PreoptimizedCLV don't works.

Is possible to use this components together?

My code and example project - using the original PreoptimizedCLV example - is in attach.

Thanks in advance for any help.
B4X:
PCLV.Initialize(Me, "PCLV", CustomListView1)
Dim words As List = File.ReadList(File.DirAssets, "english.txt")
For Each word As String In words
    PCLV.AddItem(60dip, xui.Color_White, word)
Next
    
PCLV.ShowScrollBar = False
PCLV.Commit
    
clvIS.Initialize(CustomListView1,False,True,True)
 

Attachments

  • pclv1.zip
    41.7 KB · Views: 116

asales

Expert
Licensed User
Longtime User
Thanks.
I have more than 5.000 registers.
I checked the source code of PreoptimizedCLV and I'm thinking in make a version joing this 2 components.
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I have more than 5.000 registers.
I removed the CLVIndexScroller class module and added a fast scrolling seekbar. See if this suits you. I think there is a way to add an alphabetic listing when scrolling too, but I did not have a chance to explore it in this project. But if you succeed in doing something you mentioned in your post #3, share it
 

Attachments

  • PCLVwithFastScrollForasalesByMahares.zip
    40.3 KB · Views: 120
Upvote 0

asales

Expert
Licensed User
Longtime User
I removed the CLVIndexScroller class module and added a fast scrolling seekbar. See if this suits you. I think there is a way to add an alphabetic listing when scrolling too, but I did not have a chance to explore it in this project. But if you succeed in doing something you mentioned in your post #3, share it
Thanks. I'll check.
I'm working to merge the 2 components, using the source code of the classes.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I thought PreoptimizedCLV and lazy loading are the same thing.
With a regular CLV, an empty panel is created for each item. It has many advantages and works good enough for lists of up to several thousands items.
PreoptimizedCLV doesn't create any item except of the ones visible so it can be used for huge lists.

The truth is that users never want to scroll a list with more than a few hundreds items. So if you are trying to solve performance issues of huge lists then you probably have a UX issue.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Am I wrong?
Lazy loading is a concept so it depends on the context. When I say CLV + lazy loading, I do not mean to use Preoptimized CLV. I mean that the developer should handle the visible changed event and create the layouts just before they are displayed (and also remove layouts that are no longer needed).

PCLV goes another step forward and changes the way CLV works.
 
Upvote 0
Top