B4A Library [Lib] UltimateListView

I've been working on this project for a long time and I'm very proud to release the version 4 today.

The UltimateListView is, as its pompous name says, THE ListView.

  • It can handle very long lists. This is a screenshot of a list with 245813 items, all different:

    verylonglist.jpg


  • It can mix different layouts (and they can be changed dynamically). You can use it as an expandable ListView:

    layouts.jpg


  • It has a low memory footprint and is very fast (this report comes from the Performance demo where the list has to display 128901 distinct words read from a database and the used device is a Huawei Honor single core 1.4 Ghz):

    performance.png


  • It can scroll in both directions thanks to its swipe detector:

    tables.jpg


  • The swipe detector can also be used to implement a swipe-to-dismiss or a swipe-to-reveal:

    swipedetector.png
  • You can easily add editors to your table to change its content:

    celledit.jpg


  • You can animate the items when they are added, removed, replaced or when the list is scrolled (with your own custom animation):

    animationclap.png


  • It can stack items from the bottom:

    stackfrombottom.png


  • It supports drag & drop operations (internal & external):

    dragndrop.png


  • You can synchronize lists with different item heights:

    grid.jpg
The examples will show you how to implement a Pull-to-Refresh, create sticky headers or combine several lists to make a wheel. One of the examples is an improved version of my File Explorer class.

All texts and images can be loaded asynchronously (from Internet, from a database or from a local folder), so you can scroll even if the data are not fully loaded.

The list has its own state manager.

Since September 2018, ULV is available for free. You can still donate for it if you wish.
To send the money, just click on the Donate button below (the amount to enter is in euros):


Note that UltimateListView is not a wrapper around the work of someone else. It is 100% my own code and it is based upon the standard Java ListView of Android.

The UltimateListView does not work with Android versions < 2. It cannot work with B4J or B4i.

Current version: 4.50

DOWNLOAD HERE:
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Hello Informatix!

Is there a way to save the Image directly after loadimageasync?
I have tried
B4X:
 ULV_PostLoad(Bmp As Bitmap, ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) as bitmap
,

but no result.

Thanks for help!
I'm not sure to understand what you tried (the code is missing in your post), but I confirm that you have to place your code in the PostLoad callback function. If you want to save the image for a later reuse by the list, it's not needed because LoadImageAsync can save it and reload it from the disk cache (the cache can be enabled while initializing the ULV).
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello and thanks for the fast repley.

I need the image as file on my sd-card. But the PostLoad-Event doesn't raise after loading the image async. So, in my list, the images are loading every time again and this spends to much time....
 

lbrown333

New Member
Licensed User
Longtime User
I have been intently reading through this forum post, and I am very excited to try this library! Just donated (in USD). Please let me know how I can get the library and documentation. Thanks for all your hard work.
 

Informatix

Expert
Licensed User
Longtime User
I have often the following questions:
1) I have a fairly simple list view. Each row contains a checkbox and a couple text lines. How can I access the views in the panel if I know the row number?
2) For instance, say I have 10 rows. I want to check the checkbox on row number 5 (by clicking a button outside the list view).
3) What if you tap on the checkbox? How do you tell if it was checked?

Answer:
Views are accessed in the Filler sub and, for the reasons explained at length in the User's Guide, they should not be accessed elsewhere. If your checkbox is the first view in the layout panel, you get it with:
B4X:
Dim chkbx As CheckBox = LayoutPanel.GetView(0)

If the state of your checkboxes is saved in a list of booleans named "lstBool" then you set the state with:
B4X:
chkbx.Checked = lstBool.Get(ID)
in the Filler sub. To know the state, you do not need to read the checked property of your view; you just have to read the value in lstBool.

To change the state programmatically, change first the boolean value in your list then refresh the visible items:
B4X:
lstBool.Set(5, True)
ULV.RefreshContent

To update lstBool after an user action, use the event of the checkbox:
B4X:
Sub CheckBox_CheckedChange(Checked As Boolean)
    Dim ChkBx As CheckBox = Sender
    'if you stored the ID of the row in the Tag property in the Filler sub, read the tag, otherwise call FindIDInVisibleItems
    lstBool.Set(ChkBx.Tag, Checked)
End Sub
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello!

Is it possible to write ulv.savestate in a file?

Thanks for help...
 

Sytek

Active Member
Licensed User
Longtime User
This one make me laugh!
And my choice will be clear indeed: I will change only one thing: the minimum donation amount for you is raised to 50 euros. Sorry, but I have less and less time to cope with rantings and I'm not in need of new users.
 

schimanski

Well-Known Member
Licensed User
Longtime User
It's what the function does (cf. the chapter 19 in the User's Guide).

Mmhh..can't find, what I'm looking for. I mean, is it possibe to save the state in different files. My Idea is to save the hole communications of my messenger....

Thanks for help...
 

Informatix

Expert
Licensed User
Longtime User
Mmhh..can't find, what I'm looking for. I mean, is it possibe to save the state in different files. My Idea is to save the hole communications of my messenger....

Thanks for help...
I think that you're confusing the STATE of the ULV (the used layouts, the current position, the selected items, etc.) with the CONTENTS of the ULV, which is kept in a separate data container (I suppose that you store all displayed data in a list, an array, a map, etc., so your question is probably to know how to save this memory content to the disk; in this case, read this tutorial). The ULV cannot save something that is external to it (it has no idea of how you store and retrieve your data).
 

schimanski

Well-Known Member
Licensed User
Longtime User
I think that you're confusing the STATE of the ULV (the used layouts, the current position, the selected items, etc.) with the CONTENTS of the ULV, which is kept in a separate data container (I suppose that you store all displayed data in a list, an array, a map, etc., so your question is probably to know how to save this memory content to the disk; in this case, read this tutorial). The ULV cannot save something that is external to it (it has no idea of how you store and retrieve your data).

Jo, now I have understand it. I save the list and redraw the ulv. That's ok.

Thanks for your reply...
 

walterf25

Expert
Licensed User
Longtime User
Hi Frederic, i see that this listview can be used as an expandable listview, i'm in need of this for an app i'm working on for a client of mine, i would like to buy it but i need to know if i can in fact use it as this expandable listview here. i need to add categories and under each category different items. please let me know as soon as you can and i will send you the payment right away.

thanks,
Walter
 

thedesolatesoul

Expert
Licensed User
Longtime User
Hi Frederic, i see that this listview can be used as an expandable listview, i'm in need of this for an app i'm working on for a client of mine, i would like to buy it but i need to know if i can in fact use it as this expandable listview here. i need to add categories and under each category different items. please let me know as soon as you can and i will send you the payment right away.

thanks,
Walter
I replaced that listview with ULV and it got rid of all OOM.
It is easy to do with ULV, just have to get used to a different approach. (there are also samples in his package i think)
 

Informatix

Expert
Licensed User
Longtime User
Hi Frederic, i see that this listview can be used as an expandable listview, i'm in need of this for an app i'm working on for a client of mine, i would like to buy it but i need to know if i can in fact use it as this expandable listview here. i need to add categories and under each category different items. please let me know as soon as you can and i will send you the payment right away.

thanks,
Walter
As confirmed by TheDesolateSoul, you can do any kind of expandable listview. With the support of sections, you can also manage each group parent/children as an entity. Note that the ULV handles automatically the basic type of expandable list view. For a more advanced implementation, you have to manage the parents and children yourself (that just means you will have to write more code).
 

walterf25

Expert
Licensed User
Longtime User
As confirmed by TheDesolateSoul, you can do any kind of expandable listview. With the support of sections, you can also manage each group parent/children as an entity. Note that the ULV handles automatically the basic type of expandable list view. For a more advanced implementation, you have to manage the parents and children yourself (that just means you will have to write more code).

Frederic thanks for the reply, i have made my donation please send me the library as soon as possible, thanks and look forward to playing with it.

Cheers,
Walter
 

adastra

Member
Licensed User
Longtime User
Hi
Looks interesting library. Want to know few things before buying -
1) I have 100+ images on remote server. Will your library display images from remote server ?
2) I do not want that all the images to get download at one go as it will eat up loads of memory and even sometimes it may hang app, so I want when user scrolls down only then it shall download another set of images. Maybe 20 images in one set.

Sorry, for my English . Hope I have explained clearly what I wanted?
 

Informatix

Expert
Licensed User
Longtime User
Hi
Looks interesting library. Want to know few things before buying -
1) I have 100+ images on remote server. Will your library display images from remote server ?
2) I do not want that all the images to get download at one go as it will eat up loads of memory and even sometimes it may hang app, so I want when user scrolls down only then it shall download another set of images. Maybe 20 images in one set.

Sorry, for my English . Hope I have explained clearly what I wanted?
1) The library can download the images from your server and store them in a cache to avoid downloading them again the next time.
2) It works more cleverly than that. It downloads only the images that it needs, in the background so you can scroll while it downloads, and you can decide how much concurrent downloaders are active (by default, the images are downloaded two by two). Unless you do a programming mistake or use extreme settings, Out Of Memory errors never happen.
 
Top