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
Hi Informatix, Thank you for your response.

I have this layout :

View attachment 38687

As you see i have Activity Color White (#FFFF)

I try also this code:

B4X:
Sub Item_LayoutCreator(LayoutName As String, LayoutPanel As Panel)
            LayoutPanel.Color = Colors.White
            LayoutPanel.LoadLayout("lay_menu_details")
          
End Sub

Sub Item_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
  
    LayoutPanel.Color = Colors.White
  
    Dim imageview1 As ImageView = LayoutPanel.GetView(0)
    'First view in the panel
    imageview1.Gravity = Gravity.FILL
    .....

But dont change nothing.
Any idea ?
Thank you
Marco
I need a project to try because I don't understand what could be gray if everything is white.
And please contact me by email as it is very difficult to follow a discussion per user and exchange files in this forum.
 

Informatix

Expert
Licensed User
Longtime User
B4X:
Sub Item_LayoutCreator(LayoutName As String, LayoutPanel As Panel)
            LayoutPanel.Color = Colors.White
            LayoutPanel.LoadLayout("lay_menu_details")
You should place the color change after loading the layout or it will be ignored (because it is replaced by the background color of the layout). That won't solve the problem as I see that you set the color to white in the designer.
Another important thing to mention : you should set AnimationDuration to zero in the designer as it slows down the list. This setting by default is really evil. Why did Erel changed this value some day? :mad:
 

MarcoRome

Expert
Licensed User
Longtime User
You should place the color change after loading the layout or it will be ignored (because it is replaced by the background color of the layout). That won't solve the problem as I see that you set the color to white in the designer.
Another important thing to mention : you should set AnimationDuration to zero in the designer as it slows down the list. This setting by default is really evil. Why did Erel changed this value some day? :mad:

I tried to set the color ( see code ) and change animation to 0, but nothing changes.
B4X:
                        ..........................
                        preleva.Put("log_picture_food" & i, cur.Get("picture_food"))
                        If GetDeviceLayoutValues.ApproximateScreenSize < 4 Then
                            ULV.AddLayout("TEST", "Item_LayoutCreator", "Item_ContentFiller", 33%y, True)
                        Else If GetDeviceLayoutValues.ApproximateScreenSize > 4 And GetDeviceLayoutValues.ApproximateScreenSize < 8 Then
                            ULV.AddLayout("TEST", "Item_LayoutCreator", "Item_ContentFiller", 33%y, True)   
                        Else If GetDeviceLayoutValues.ApproximateScreenSize > 8 Then
                            ULV.AddLayout("TEST", "Item_LayoutCreator", "Item_ContentFiller", 20%y, True)
                        End If
                       
                        ULV.BulkAddItems(1, "TEST", 0)
            Next
           Activity.Color = Colors.White
 

Bryanne Vega

Member
Licensed User
Longtime User
On the slide to reveal options, are the options unlimited? or you can only put a specific amount of views?
 

Informatix

Expert
Licensed User
Longtime User
A new version is available for download:

Changelog v4.06:
- I removed the layout id from the Tag property of item panels (you can use this property now as you wish);
- I fixed a bug when the list is empty;
- I fixed an issue in the Editor demo;
- The checkbox of ClsExplorerForULV is now a bit larger (45dip).
 

Bryanne Vega

Member
Licensed User
Longtime User
I've tried handling an on Click event but cant seem to find out how, would anyone give a simple example on getting a click/longclicked panel?
 

Informatix

Expert
Licensed User
Longtime User
I've tried handling an on Click event but cant seem to find out how, would anyone give a simple example on getting a click/longclicked panel?
You should start by reading the User's Guide (there's a chapter on the subject: User Actions) then look at the numerous examples implementing a Click event. The tutorial is also a good starting point. There's a Click event handler in MyFirstList1, which is the most basic example that you can find.

Please note that I prefer to exchange by email for support.
 

Bryanne Vega

Member
Licensed User
Longtime User
You should start by reading the User's Guide (there's a chapter on the subject: User Actions) then look at the numerous examples implementing a Click event. The tutorial is also a good starting point. There's a Click event handler in MyFirstList1, which is the most basic example that you can find.

Please note that I prefer to exchange by email for support.
ItemClick is not working.

Are never called when using the animation, I cant click an item, only swipe them.

B4X:
Sub SlidingPanel_Click ()

End Sub

Sub ULV_ItemClick(ItemID As Long, Position As Int, ClickedPanel As Panel)

End Sub
 

Informatix

Expert
Licensed User
Longtime User
ItemClick is not working.

Are never called when using the animation, I cant click an item, only swipe them.

B4X:
Sub SlidingPanel_Click ()

End Sub

Sub ULV_ItemClick(ItemID As Long, Position As Int, ClickedPanel As Panel)

End Sub
There's a big difference between "this is not working" and "I don't know how to do this" (or its variant: "I probably did a mistake somewhere"). Concerning ULV, the second sentence is the right explanation in 99 cases on 100. I answer to your case by email.
 

Dave O

Well-Known Member
Licensed User
Longtime User
For what it's worth, ItemClick in 4.06 works fine for me, though I'm not using animation or swipe.

Also, EmptyView now works perfectly. Thanks!
 

Bryanne Vega

Member
Licensed User
Longtime User
For what it's worth, ItemClick in 4.06 works fine for me, though I'm not using animation or swipe.

Also, EmptyView now works perfectly. Thanks!

Swipe is a little conflicting with click since SwipePanel_Touch() is blocking all touch events.
 

Informatix

Expert
Licensed User
Longtime User
Swipe is a little conflicting with click since SwipePanel_Touch() is blocking all touch events.
Not at all. In the DismissConfirm example, the goal of the sliding panel is to intercept all touch events so the buttons that are masked below the panel do not receive any event (the panel hides them so it would be weird if these buttons were activated while hidden). To block the touch events, I created an empty Touch event handler for the panel. BUT this event handler can handle clicks if you need to, as I explained in my email. It's a touch event handler, so it receives touch events. There's absolutely no conflict with anything and it's not even related to ULV. Trying to detect an ItemClick while you have three views inside the item panel that intercept clicks (two buttons+1 panel), moreover with one of these views that covers the whole area of the item, has no chance of success. But who cares? You can detect these clicks at the sliding panel level.
 

itgirl

Active Member
Licensed User
Longtime User
hello thanks for the update just one question after i update in the sub Item_Filler(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)

i always get the LayoutPanel null [(BALayout): Layout not available]
even in the example files the same ?!
 

Informatix

Expert
Licensed User
Longtime User
hello thanks for the update just one question after i update in the sub Item_Filler(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)

i always get the LayoutPanel null [(BALayout): Layout not available]
even in the example files the same ?!
It does not mean that the panel is null, only that you cannot access its BALayout properties because it is not (and never was) a B4A panel. For example, trying to get its Top value or trying to change its width leads to a crash. It's normal.
 

itgirl

Active Member
Licensed User
Longtime User
It does not mean that the panel is null, only that you cannot access its BALayout properties because it is not (and never was) a B4A panel. For example, trying to get its Top value or trying to change its width leads to a crash. It's normal.
yes thats exactly what i was trying to do to change the height of the panel and if i add try and catch then the height is changed and i avoid the crash but i was wondering if there's something else i can do to fix this
 
Top