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:

AbbasMohammed

Member
Licensed User
Longtime User
Dear Frédéric,
Many thanks for your great work and thanks again for the Animator pack with ULV you added freely.
Abbas
 

bobsimoneau

Member
Licensed User
Longtime User
Guys he is on Vacation at the moment, i'm not sure if he checks his e-mails while he's on Vacation, i'm sure he will get back to you sooner or later.
Thanks for the response. I guess he does check emails, I am all set now.
 

hzytsoft

Member
Licensed User
Longtime User
hi man
i wanna use u UltimateListView lib
i konw itis by sales
so plese call me price

you friend

jim
 

Eduard

Active Member
Licensed User
Longtime User
Hi Informatrix,

I just donated 25 euros for the ULV. You can send it to eduardboer ~ at ~ gmail.com

Eduard
 

Eduard

Active Member
Licensed User
Longtime User
I've sent the version 3.91 to all donators. Check your inbox (or your spam folder).

A version 4.0 is planned for november. Send me a message about the features you'd like to see in this new version.

Hi,

I currently can't use the LoadImageAsync method because the webserver requires a POST instead of a GET to download the thumnail. All thumbnails are downloaded from the same URL but with different POST data (json, xml, etcetera..).

http://en.wikipedia.org/wiki/POST_(HTTP)

Could you add an extra parameter to LoadImageAsync2(imageView, imageLocation, imageID, imagePostData)


Also another feature request: use of https is possible (I assume). I would like the option to allow of disallow download via https from untrusted servers (with self signed certificates) if that isn't already possible

Thanks,
 

Informatix

Expert
Licensed User
Longtime User
There are so many possibilities for loading an image (with FTP, HTTP, HTTPS, from a database, etc.) that it would be impossible to handle all cases even with two or three functions. That's why I created the custom loading mechanism. You write your custom loader in the CustomLoad sub, you register this sub with SetLoadImageCallbacks and you load your images with LoadImageAsync by prefixing the path with "custom:". The CustomLoad code is run asynchronously. If you want to run it synchronously, call directly the sub instead of using LoadImageAsync.
 

Eduard

Active Member
Licensed User
Longtime User
Hi,

I've been experimenting and the list does have some minor bugs. Scolling is very smooth, but when I use the fast scroller to go really really fast all the way from top to bottom, or from bottom to top, the list gets mixed up often. If I than scroll up and down again everything is correct again (so it it not the data). I'm not using ULV cache because all itemdata is already loaded in memory (in gItemList As List).

Another error I get is that after I removed and item from the list ( gItemList.removeItemAt(i) and myULV.removeItemAt(i) the ULV still calls the sub Item_ContentFiller with an ItemID>numberOfItems-1

I now have a workaround in item_contentFiller. I check for boundaries
B4X:
Sub Item_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
   If ItemID>gItemList.Size-1 Then
        'out of bounds
        If myULV.NumberOfItems> gItemList.Size Then
            myULV.RemoveItemAt(myULV.NumberOfItems-1)
        End If
    Else

List works perfect besides that, thanks,

Eduard
 
Last edited:

Eduard

Active Member
Licensed User
Longtime User
I think that the reason the list get's mixed up because LoadImageAsync and LoadTextAsync subs return data of an item that is not visible anymore to an random item that is visible. Data is still returned to items that are not displayed, because the user has scrolled further.

Problem is that the title of my item's doesn't correspond with the rest of the item after fast scrolling. The title is loaded in memory in a list before the list is dislayed, the rest of the item is loaded async and added to this list.

I now fixed this using a Timer that refreshes the ULV 10 times every 1/3 second after the user stopped scrolling.

@Informatrix
I could upload the project if you'd like to take a closer look. It's a small project

Regards,
 

Informatix

Expert
Licensed User
Longtime User
Hello,

I'd like to see the code used to get this result before confirming there's a bug. Please send it to my mailbox, not in this forum.

As you can imagine, I tested the fast scroller one million times during the development and I should have noticed a so obvious problem. Moreover, in the version 3.x, I delegate the scroller management to the system. So I doubt there's a problem with it, but who knows?

The use of a timer is very intriguing because I never had a reason to use a timer with ULV.
 

Eduard

Active Member
Licensed User
Longtime User
Hi, I'll send you the project in a minute.


I have some question about ID's and positions after reading documenation 3.91

I read that ItemID is automatically incremented when using BulkAddItems.

my questions:
1) Is ItemID the index of a list or the key of a map? What happens to ItemID. if I remove an item off the list
2) How does ItemID relate to position
3) How does ItemID relate to TextID
4) How does ItemID relate to imgID
5) How does ItemID relate to RowID

Does adding seperators to an ULV increment the position?
 

Informatix

Expert
Licensed User
Longtime User
1) ItemID is an ID for your own usage and is not managed by ULV. It is supposed to be unique for each item. In the ItemID, you can store the ID of a record in a database, the key of a map, the index of an array... What you want.
2) No relation. The ID and the position are exactly like the ID and the position in a table of a database. In my examples, I create all my items with an ID starting at 0, and I increment this number with BulkAddItems, so the ID correspond to the position but it's just coincidental.
3) No relation. TextID is an ID related to the resource, not to the item.
4) Same answer as 3.
5) It's you that defines the relation between them.

If I remember correctly, the separator counts, indeed. It's easy to check.
 

Eduard

Active Member
Licensed User
Longtime User
I think it's difficult to keep the ULV in sync with my array (list) that contains the data. I cannot store the index of an array in ItemID, because when the user deletes an item from the array the index of the array shifts, but the ItemID in the ULV will not. If use delete item x in the ULV the item x will simply not be available anymore, but in my array item x wil simply be the next item.

I cannot use position as index of my array either, because the separator does count too and I do not know how many separators are displayed above the item.

So ItemID is more like a tag? I don't have to put unique values in it. I could store the separator count in ItemID. But I in my opinion the code is than hard to read. I'd use a field for something where it's not supposed to be used for.

It would help if in all functions where position is supplied, the separatorcount whould be too.
 
Top