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:

Kevin

Well-Known Member
Licensed User
Longtime User
I would be glad to add such a function but here are some reasons why that will never be done:
1) The ULV does not store data and does not handle anything else than the panels you pass to it through the events. It has no idea of what's inside each item.
2) Anyway, the data could not come from the views because the ULV holds only visible items.
3) We could imagine to get all needed data through an event but let's suppose that you have 10000 records in a database on a remote server. It wouldn't be a good idea to retrieve all these records to allow the ULV to do the sort. It is far more efficient to sort directly in the database (either on the fly to a temporary table, or by selecting views already sorted) and to transfer to the ULV only the new set of visible records.
4) What sorting algorithm should I choose? The choice of this algorithm depends strongly on the data to sort and whether they are already partially sorted or not sorted at all. Databases have optimized algorithms to get the best performance in various situations. I don't want to reinvent the wheel; it's too much work and I won't get a better result.

LOL. Well, I deserved that bit of a rant. I had read this entire thread before donating and actually got a kick out of your stating such things repeatedly. :D

I'm afraid I fell victim to an impulse decision to post that thinking it would be a great feature, forgetting what I had already read. Of course everything you said is true and it was a silly request. If I do it again feel free to reach through the monitor and smack me upside the head. :D
 

Informatix

Expert
Licensed User
Longtime User
LOL. Well, I deserved that bit of a rant. I had read this entire thread before donating and actually got a kick out of your stating such things repeatedly. :D

I'm afraid I fell victim to an impulse decision to post that thinking it would be a great feature, forgetting what I had already read. Of course everything you said is true and it was a silly request. If I do it again feel free to reach through the monitor and smack me upside the head. :D
I'm making a big bludgeon... :D
 

momoanywhere

Member
Licensed User
Longtime User
Hi,

Appreciated for your great work! I've just sent my donation to alexgranxxxxx. Hope to get it soon. Thanks.
 

momoanywhere

Member
Licensed User
Longtime User
Hi Informatix,

I am not sure if it would be more easy for identifying my donation when posting the transaction number as well. If so, it's 3FB3084114310591H. Do I need to send you my email address as well? Thanks.
 

Informatix

Expert
Licensed User
Longtime User
An user submitted an interesting case showing that the ULV can produce an IndexOutOfBounds in some very rare cases, with no obvious explanation. It is due to a notification that is not received (or not received quickly enough, I don't know) by the internal adapter of the list (the parent class of the custom adapter I wrote for ULV). You can control that you're in this case by running the following code (with the JavaObject lib):
Dim jULV As JavaObject = ULV
Log(jULV.RunMethod("getChildCount", Null))
If the result is different from a call to NumberOfItems or the number of items that you can count visually, then the internal data of the adapter are wrong. To fix this issue, just do a DoEvents to let some time to the adapter to receive the notification.
 

ilan

Expert
Licensed User
Longtime User
i start working with the ulv and its really great
i have some problems with the stickey panel i got errors in the sub ULV_scrolled so i give up the sticky function
but i got an other question, when i load the ulv i see in the right top side of the ulv for 1-2 sec the scroll button and then it disappear

is it possible not to show it at all (also while scrolling down/up?)

got it:

B4X:
Dim r As Reflector
    r.Target = ulv3
    r.RunMethod2("setVerticalScrollBarEnabled", False, "java.lang.boolean")
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
i start working with the ulv and its really great
i have some problems with the stickey panel i got errors in the sub ULV_scrolled so i give up the sticky function
but i got an other question, when i load the ulv i see in the right top side of the ulv for 1-2 sec the scroll button and then it disappear

is it possible not to show it at all (also while scrolling down/up?)

got it:

B4X:
Dim r As Reflector
    r.Target = ulv3
    r.RunMethod2("setVerticalScrollBarEnabled", False, "java.lang.boolean")
You don't need this. As said in the documentation, you can change the visibility with SetScrollbarStyle. Set it to SCROLLBAR_INVISIBLE.
 

Derek Jee

Active Member
Licensed User
Longtime User
Hi Informatix

I have been playing about with the ListView and CustomListView and whilst they work as I need, I will want more from them as time goes on. I will be creating a number of apps, data entry mostly, and want the user to be able to use the device in portrait or landscape. In landscape I would like the whole activity to get bigger for those of whom have vision problems and wonder if I have any way of setting one of your lists to change size on orientation rather than have to change each view individually.. For example on my EditText I set the text size at 1.5%x which nicely changes on orientation.. Love your work.. Do you have any other chargeable libs?

Thank you,

Derek

PS is the donation amount still 25 Euros?
 

Informatix

Expert
Licensed User
Longtime User
Hi Informatix

I have been playing about with the ListView and CustomListView and whilst they work as I need, I will want more from them as time goes on. I will be creating a number of apps, data entry mostly, and want the user to be able to use the device in portrait or landscape. In landscape I would like the whole activity to get bigger for those of whom have vision problems and wonder if I have any way of setting one of your lists to change size on orientation rather than have to change each view individually.. For example on my EditText I set the text size at 1.5%x which nicely changes on orientation.. Love your work.. Do you have any other chargeable libs?

Thank you,

Derek

PS is the donation amount still 25 Euros?
There's nothing automatic for that in ULV. But if you base the size of all your views on the display width (sizes in %x), they will be bigger in landscape. No need for anything else.
The donation amount is still 25 euros.
 

Derek Jee

Active Member
Licensed User
Longtime User
Thank you..

My donation is on its way to you :).. Very exciting indeed..

Derek.
 

Derek Jee

Active Member
Licensed User
Longtime User
Information Overload !! So many uses.. Thank you..

Derek.
 

Derek Jee

Active Member
Licensed User
Longtime User
Hi Informatix

My databases all have GUID as ids.. Will your id requirements work with these or should I create a new numeric id when creating / importing my data into the database?

Thanks,

Derek.
 

Informatix

Expert
Licensed User
Longtime User
Hi Informatix

My databases all have GUID as ids.. Will your id requirements work with these or should I create a new numeric id when creating / importing my data into the database?

Thanks,

Derek.
GUIDs are strings or 128-bit integers (in general) and IDs in ULV are long integers (64 bits). So you cannot use a GUID as is or convert it reliably to a long.
It's probably too late to change your tables but, for me, GUIDs are a waste of space and performance in a database. They have more disadvantages than advantages. They can't be ordered to get the insertion order, for example. Unless there's a specific need for them (e.g. replication that needs a GUID), you should use a simple ID instead. And if you want to keep them, nothing prevents you from adding an ID column.
 

Derek Jee

Active Member
Licensed User
Longtime User
Thank you.. They are legacy databases and replication was on their mind (I agree they have more disadvantages). When I download data into my SQLite db I will add an integer field for your ids.

Derek.
 

Derek Jee

Active Member
Licensed User
Longtime User
Hello there Informatix

Firstly what a great library.. I am so happy that you have created this for us. Secondly I have a question on data and the use of your list and wonder whether you'd prefer the question on here or via email. I will post it here this time in any case..

When scrolling down a list of items, I tick my checkbox I've added and that fires an event in my db to save something.. If I scroll own far enough that particular checkbox moves off screen. When I scroll back the tick is now gone from the checkbox. I understand from a search that I cannot update the cursor that I am using which the list is feeding off but would like the ticks to show when the items comes back to be viewed.. can you suggest the best way for this. I guess an array of clicked items may be the way to go but would like your opinion on it as I am sure I'm not the first to ask (I hope)..

Thank you very much..

Derek.
 
Top