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:

Humberto

Active Member
Licensed User
Longtime User
Hi Informatix

Did you receive the donate confirmation?

I sent to alexgrand@.......

Thanks
 

Humberto

Active Member
Licensed User
Longtime User
Hi

Could you send again ?

I didn´t find it.

The spam folder already empty

Thanks

Humberto
 

incendio

Well-Known Member
Licensed User
Longtime User
Dear Informatix,

I am planning to use this library to replace flexible table (a free class from this forum), to display data from sqlite database.

I have a few questions about this library :
1) my skill in b4a and java is limited, when using flexible table, I just use LoadFromSQLDb function in that class to load data from sqlite, it is quite simple for me. Is this library also have a simple function to load sqlite data?
2) I am using sqlite data in file and in memory, can this library load data from sqlite in memory?
3) I need to format certain numeric value for displaying purpose only, without change underlying data, for ex, in sqlite, the value stored as 1000, but when displaying in table/list, need to display it as 1,000. The original flexible table class do not have this ability, but since the source code is available, I can make a small modification to make it happen. Does your library support for this formatting? If not, is there any other way to achieve it?
4) In your demo, ULV_Filter_Demo, there is a demo to search a city. The list in that demo has 3 columns city,country,longtitude&latitude. Can user modify so the search is not only for the city, but also including other columns?
5) I am also using your clsfloatingwindows class, can this list loaded to this floating windows?

Thanks.
 

Informatix

Expert
Licensed User
Longtime User
Dear Informatix,

I am planning to use this library to replace flexible table (a free class from this forum), to display data from sqlite database.

I have a few questions about this library :
1) my skill in b4a and java is limited, when using flexible table, I just use LoadFromSQLDb function in that class to load data from sqlite, it is quite simple for me. Is this library also have a simple function to load sqlite data?
2) I am using sqlite data in file and in memory, can this library load data from sqlite in memory?
3) I need to format certain numeric value for displaying purpose only, without change underlying data, for ex, in sqlite, the value stored as 1000, but when displaying in table/list, need to display it as 1,000. The original flexible table class do not have this ability, but since the source code is available, I can make a small modification to make it happen. Does your library support for this formatting? If not, is there any other way to achieve it?
4) In your demo, ULV_Filter_Demo, there is a demo to search a city. The list in that demo has 3 columns city,country,longtitude&latitude. Can user modify so the search is not only for the city, but also including other columns?
5) I am also using your clsfloatingwindows class, can this list loaded to this floating windows?

Thanks.
My library does not load anything so it's difficult to answer to your questions. It's not a B4A Listview with a few enhancements, it's a different view with a different philosophy. It does not care if your data come from a database, a file or memory. It asks a data when it needs to display it and your code has to provide it through an event. So data are managed by your code. If you don't know how to load the data that you need and format them properly for display, then you'll be in trouble with my library.
 

incendio

Well-Known Member
Licensed User
Longtime User
So you said, if the screen can only display 20 rows, developer supply these rows to your library and wait for event, perhaps, on scroll event?
When user scroll, developer supply again another 20 rows, is this how your library works?
What about a return value, when user clicks your list, is this library able to return hidden value that's not display to user?
For ex, I have 3 column, id, name, address, I want to display to user only name and address, but when user clicks, I need id as a return value, can your library do this?
 

Informatix

Expert
Licensed User
Longtime User
So you said, if the screen can only display 20 rows, developer supply these rows to your library and wait for event, perhaps, on scroll event?
When user scroll, developer supply again another 20 rows, is this how your library works?

Yes, it's the basic idea. With a few optimizations... ;)

What about a return value, when user clicks your list, is this library able to return hidden value that's not display to user?
For ex, I have 3 column, id, name, address, I want to display to user only name and address, but when user clicks, I need id as a return value, can your library do this?

Yes, each item has an ID. This ID does not change even if you sort your list.
 

nwhitfield

Active Member
Licensed User
Longtime User
If I can attempt to summarise; with ULV you tell it that you have X items to show in the list. You can add them all at once, or individually. Either way, each item has an id. But they're not displayed right away - it just knows that, for instance, item id 1 is at position 1, item id 2 is at position 2.

When the list is actually displayed, the ULV calls a sub, indicating the id and the position of of a specific item; it does this for each one that's visible. The sub can then do things, like query a database, or get items from a list, based on the id and/or position, and fills the layout for that item with the results.

When something is clicked in the list, again, a sub gets the id and position, and can handle them appropriately, deciding which bit of the underlying data needs to be updated.

You can use a combination of sources of information for each part; for instance, in my app, I create a list of people who are online using ULV; that's based on a list returned from the server. When the information is displayed, when I fill the layout, some of the information comes from the list (based on the ID, which I used as an index into the list), while other bits come from a database query, using the ID to look information up.

I found ULV very flexible - but you have to get your head around the fact that it works in a slightly different way to other lists, in terms of the initial loading. When it comes to the clicking on an entry, it's not really so different.

Biggest difference could perhaps be put like this:

In a CustomListView, etc, you usually create each element at the start, processing the data to build all the entries at the same time
In a ULV, you just associate your data (by ID) with the list at the start; each entry is built only when it's actually displayed
 

Informatix

Expert
Licensed User
Longtime User
If I can attempt to summarise; with ULV you tell it that you have X items to show in the list. You can add them all at once, or individually. Either way, each item has an id. But they're not displayed right away - it just knows that, for instance, item id 1 is at position 1, item id 2 is at position 2.

When the list is actually displayed, the ULV calls a sub, indicating the id and the position of of a specific item; it does this for each one that's visible. The sub can then do things, like query a database, or get items from a list, based on the id and/or position, and fills the layout for that item with the results.

When something is clicked in the list, again, a sub gets the id and position, and can handle them appropriately, deciding which bit of the underlying data needs to be updated.

You can use a combination of sources of information for each part; for instance, in my app, I create a list of people who are online using ULV; that's based on a list returned from the server. When the information is displayed, when I fill the layout, some of the information comes from the list (based on the ID, which I used as an index into the list), while other bits come from a database query, using the ID to look information up.

I found ULV very flexible - but you have to get your head around the fact that it works in a slightly different way to other lists, in terms of the initial loading. When it comes to the clicking on an entry, it's not really so different.

Biggest difference could perhaps be put like this:

In a CustomListView, etc, you usually create each element at the start, processing the data to build all the entries at the same time
In a ULV, you just associate your data (by ID) with the list at the start; each entry is built only when it's actually displayed
Sometimes, things are better explained by someone else.
 

incendio

Well-Known Member
Licensed User
Longtime User
Although not fully understand, but thanks a lot guys for the explanation.

I will give it a try, donation sent, id #29C48486D1138213G.

Thanks.
 

incendio

Well-Known Member
Licensed User
Longtime User
Dear Informatix,

I have managed to display data into ULV by modification Search.bas in the example Searh_filter. This is the sample where the app display a list of cities and user can searh city by typing its name in edit text box.

From these codes
B4X:
    dbCursor = Main.dbSQL.ExecQuery("SELECT id, * FROM Cities ORDER BY City, Country")
    For i = 0 To dbCursor.RowCount - 1
        dbCursor.Position = i
        ULV.AddItem("ROW", dbCursor.GetLong("id"))
    Next

It seems that all city loaded at once into a ULV.

Like you said before, ULV able to load partial data and reload data again when some event triggered.

Can you point me, which example file supplied by this library that have this ability so I can learn it?

Thanks.
 

Informatix

Expert
Licensed User
Longtime User
Dear Informatix,

I have managed to display data into ULV by modification Search.bas in the example Searh_filter. This is the sample where the app display a list of cities and user can searh city by typing its name in edit text box.

From these codes
B4X:
    dbCursor = Main.dbSQL.ExecQuery("SELECT id, * FROM Cities ORDER BY City, Country")
    For i = 0 To dbCursor.RowCount - 1
        dbCursor.Position = i
        ULV.AddItem("ROW", dbCursor.GetLong("id"))
    Next

It seems that all city loaded at once into a ULV.

Like you said before, ULV able to load partial data and reload data again when some event triggered.

Can you point me, which example file supplied by this library that have this ability so I can learn it?

Thanks.
I prefer to exchange by email because I cannot send or receive files in this forum and I have too many users to manage all discussions in a single thread; I would be quickly lost.
That being said, did you read first the User's Guide ? As I stated (and Nigel explained) previously, the ULV does not load anything at the beginning. Not partially, not fully. Nothing. It just associates an ID and a layout with each item. This is explained in details in the documentation. And there's a tutorial for the first steps.
 

incendio

Well-Known Member
Licensed User
Longtime User
Ok, thanks for the explanation.

I have read the documentation, but not fully understand, will try to read again and will send an email if I stuck.
 

Mauro

New Member
Licensed User
Longtime User
Hi,
i just donatet EUR 25.
Please send me the license...

Your work, as always, is much appreciated.
 

Kevin

Well-Known Member
Licensed User
Longtime User
I have begun replacing my listviews with the new ULV. Very awesome so far! I was wondering if it would be possible to add a method for sorting (ascending or descending) the items? I know this can be done in a roundabout way "externally" but figured it would be a nice built-in function so we can allow the user to quickly sort the items alpha-numerically by calling a sort function.
 

Informatix

Expert
Licensed User
Longtime User
I have begun replacing my listviews with the new ULV. Very awesome so far! I was wondering if it would be possible to add a method for sorting (ascending or descending) the items? I know this can be done in a roundabout way "externally" but figured it would be a nice built-in function so we can allow the user to quickly sort the items alpha-numerically by calling a sort function.
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.
 

ANSA

Member
Licensed User
Longtime User
Hi Informatix,
I have just sent you my donation. hope to get the file soon.
 
Top