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
Users have reported an issue with LoadImageAsync. Since Android v5, some images are not fully downloaded and a lot of error messages can be seen in the log. I tried to add a workaround in a previous version of ULV but it seems that's not enough. Unfortunately, the code that fails to work properly is in the Android API, not in the ULV code.
Downloading images is not a core feature of ULV (ULV is not supposed to handle data so this downloading code should not be in the lib), but I feel the need to keep it working as expected, without breaking the existing code, so I'll see next week if I can replace the calls to the Google's API by calls to the new OkHTTP lib used by B4A. I don't promise anything.
An alternative is to use a custom loader (as you do when you want to load an image from a database) and download images with another library.
I'm sorry for the inconvenience.
 

peacemaker

Expert
Licensed User
Longtime User
Is it correct that ULV cannot:
1) contain layout with scrollable views (GoogleMap)
2) be put itself into a ScrollView
?

p.s. trying to make vertically swiping interface like here
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
It's question that is important for all ULV users - this is the reason of my this public post. If you think another - let's remove the posts.
I tried to make the interface with scrolling views inside the scrolling parent, and could not reach the result.
But if it's common issue, not related only to ULV - so asked you.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
It's question that is important for all ULV users - this is the reason of my this public post. If you think another - let's remove the posts.
It's the answer that may interest other users, not the question. So I repeat the answer for everyone: theoretically, a scrolling view cannot work well inside another scrolling view because the parent view intercepts the touch events and consumes them for its own scrolling, so the child view cannot see the events of the scrolling gesture. You can disallow the interception of touch events in some views, not in ULV.
 

Informatix

Expert
Licensed User
Longtime User
Good news: I replaced the code downloading images and the new version with OkHttp seems to work fine. My code is now a lot simpler as I removed many workarounds. Maybe I will add the possibility to add credentials for downloading on servers requiring an authentication.

Bad news:
an user reported a bug with Android 7 when you click on an item with SelectionMode set to SELECTION_SINGLE. The ClickedPanel got with the event is null because the visible items are recreated when the selection code is run, and since I disabled the recycling under Android 7, the clicked panel does no longer exist when the event code is run. The only proper solution that I see is to remove ClickedPanel from the event parameters. This parameter should not be there anyway as I always advise against accessing directly the panels to get data.
Tell me what you think of it.
 

johndb

Active Member
Licensed User
Longtime User
Good news: I replaced the code downloading images and the new version with OkHttp seems to work fine. My code is now a lot simpler as I removed many workarounds. Maybe I will add the possibility to add credentials for downloading on servers requiring an authentication.

Bad news:
an user reported a bug with Android 7 when you click on an item with SelectionMode set to SELECTION_SINGLE. The ClickedPanel got with the event is null because the visible items are recreated when the selection code is run, and since I disabled the recycling under Android 7, the clicked panel does no longer exist when the event code is run. The only proper solution that I see is to remove ClickedPanel from the event parameters. This parameter should not be there anyway as I always advise against accessing directly the panels to get data.
Tell me what you think of it.
I'm using clickedpanel often. That's how I access the views in the selection. :( I'm currently using version 4.20 as I had problems with accessing views with newer versions. I haven't had time to submit a pruned down app showing the problem but will do so next week. No problems using UlimateListView 4.20 with Android 4.4 to 7.1
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
I'm using clickedpanel often. That's how I access the views in the selection. :( I'm currently using version 4.20 as I had problems with accessing views with newer versions. I haven't had time to submit a pruned down app showing the problem but will do so next week. No problems using UlimateListView 4.20 with Android 4.4 to 7.1
I wait for your email describing the problem with the recent versions.

My question was not clear enough: is there a case where ClickedPanel is the best way to access the views? There's maybe a case that I'm not aware of or that I don't remember. Using it is convenient, for sure, but it is not the recommended method. Removing this parameter is the only solution that I see for now. When I raise the ItemClick event, the clicked panel still exists, but when your code receives the event, it has gone because in the meanwhile the views were recreated by the selection code (the Filler sub is called for each item to let it update its state).
 

fredo

Well-Known Member
Licensed User
Longtime User
I'm using clickedpanel often.
Me too.

I make heavy use of ClickedPanel in my projects to pass values that are created at filltime via tags of views ...
05-05-_2017_10-59-22.jpg

...and it is working very well as you can see in this app: https://play.google.com/store/apps/details?id=com.rolloapps.fby&hl=en
https://play.google.com/store/apps/details?id=com.rolloapps.fby&hl=en
I know that the underlying datasource should be the only source of item-related data, but over the years ClickedPanel was a reliable transporter for all kind of objects to make them shorthand available in _ItemClick().
 

Informatix

Expert
Licensed User
Longtime User
Me too.

I make heavy use of ClickedPanel in my projects to pass values that are created at filltime via tags of views ...

...and it is working very well as you can see in this app: https://play.google.com/store/apps/details?id=com.rolloapps.fby&hl=en
I know that the underlying datasource should be the only source of item-related data, but over the years ClickedPanel was a reliable transporter for all kind of objects to make them shorthand available in _ItemClick().
I understand that it is convenient and I don't like breaking existing code but, if I keep this parameter, I will have to explain why it crashes your app under Android 7 as soon as you set the selection mode of ULV.
Note that you can get the clicked panel with this code:
B4X:
Sub getClickedPanel(Position As Int) As Panel
   Dim JO As JavaObject = ULV
   Return JO.RunMethod("getChildAt", Array(Position))
End Sub
Sub ULV_ItemClick(ItemID As Long, Position As Int, ClickedPanel As Panel)
   Dim MyLabel As Label = getClickedPanel(Position).GetView(0)
...
EDIT: I found at least one case where the code above is not reliable.
 
Last edited:
Top