B4A Library [Lib] UltimateListView

fredo

Well-Known Member
Licensed User
Longtime User
I have recently purchased the library and was immediately really excited by the examples. By using the enclosed documentation is was able to build fast complex scrollviews within an hour or so. Images from the device or from the web are easy to integrate.

I am smitten. ULV is a really useful module package at a very reasonable price.
 

Inman

Well-Known Member
Licensed User
Longtime User
Nice to see some positive reviews. I have a question.

In one of my apps, there is a vertical scrollview. It contains about 50 panels. Each panel has 5 labels and 2 imageviews. Since the content changes each time, as it is populated by downloading from a server, the whole UI is generated via code only and not with designer. On my Galaxy Note running Android 4.0.4, it takes a while to load this whole layout. In fact even the spinning wheel of ProgressDialogShow, with the message "Please wait", stays stand still for about 2 seconds.

I am not sure how different your method of implementation of UltimateListView is, from the B4A's native ListView. But I was wondering, if I switch to your library and replace the ScrollView with UltimateListView, is it possible the loading time would decrease?
 

Informatix

Expert
Licensed User
Longtime User
But I was wondering, if I switch to your library and replace the ScrollView with UltimateListView, is it possible the loading time would decrease?

Absolutely YES.

Before ULV, I was using my CheckList class, but I had three issues with it:
- out of memory when the list was full of bitmaps
- loading time when the list was loaded with hundreds of items
- item layouts too static for my needs

I created the ULV to solve all of these issues.

To give you an idea, this is the average loading time of one of my lists displaying 600 rows of 4 cells (with a Huawei Honor, single core 1,4 Ghz) between List.Initialize and List.DisplayItems: 350ms.
 

Inman

Well-Known Member
Licensed User
Longtime User

Sounds great. I will buy it before the end of this month.
 

GabrielM

Member
Licensed User
Longtime User
Hi Informatix,

Just donate for ULV today. Can't wait to get it :sign0098:

Thank you, your coding much appreciated.

Best regards,
Gabi.
 

fredo

Well-Known Member
Licensed User
Longtime User
I added an example to the ULV package to show that all layouts can change in real-time (the height of each item is modified accordingly):

Hi Frédéric,

I just love the ULV, in particular the variable version.
With the documentation and examples I basically had an easy start.

But nonetheless, I am not quite clear how to implement the "AddLayout (..)" with variable height for multiple views on a panel.

E.g. I want in the ULV "Demo_Gallery" in "Item_LayoutCreator (..)" make the lblText2.Height depending on the content.

B4X:
Sub Item_LayoutCreator(LayoutName As String) As View
   'The Item layout is a classic ListView layout: an ImageView on the left and two Labels beside.
   Dim pnl As Panel
   Dim gd As GradientDrawable
   Dim Couleurs(2) As Int
   Couleurs(0) = Colors.DarkGray
   Couleurs(1) = Colors.Black
   gd.Initialize("TOP_BOTTOM", Couleurs)
   pnl.Initialize("Item")
   pnl.Background = gd

   Dim ivImage As ImageView
   ivImage.Initialize("")
   ivImage.Gravity = Gravity.NO_GRAVITY
   pnl.AddView(ivImage, 0, 0, 70dip, 70dip)   ' Fixed height OK

   Dim lblText1 As Label
   lblText1.Initialize("")
   lblText1.TextColor = Colors.White
   lblText1.TextSize = 15
   lblText1.Typeface = Typeface.DEFAULT_BOLD
   lblText1.Gravity = Gravity.TOP
   pnl.AddView(lblText1, 80dip, 5dip, 100%x - 90dip, 25dip) ' Fixed height OK

   Dim lblText2 As Label
   lblText2.Initialize("")
   lblText2.TextColor = Colors.LightGray
   lblText2.TextSize = 13
   lblText2.Typeface = Typeface.DEFAULT
   lblText2.Gravity = Gravity.TOP
   pnl.AddView(lblText2, 80dip, 29dip, 100%x - 90dip,  << variable height here >>>)

   '   Dim r As Reflector
   '   r.Target = lblText2
   '   r.RunMethod2("setMaxLines", 2, "java.lang.int")
   '   r.RunMethod2("setHorizontallyScrolling", False, "java.lang.boolean") 
   '   r.RunMethod2("setEllipsize", "START", "android.text.TextUtils$TruncateAt")

   Return pnl
End Sub

I understand the basic concept of ULV and know the function of "su.MeasureMultilineTextHeight(...)" in "Demo_Variable" for a single Layout so far.

My problem right now is to get the "AddLayouts" and "_LayoutCreator" togther, to get multiple Views with variable height on one ULV-panel together.

Any hint in the right direction would be appreciated.

Regards,
fredo
 

Informatix

Expert
Licensed User
Longtime User

Support is done only by email. I will send you the answer ASAP.
 

Mahares

Expert
Licensed User
Longtime User
Support is done only by email. I will send you the answer ASAP
1. I think you are making a big mistake by not answering in this forum, because you are not showing your potential buyers what it can do. What are you afraid of? If one sees the answer and does not have the paid version of ULV, they cannot steal the answer anyway, but can make a calculated decision as to whether it is worth buying or not.
2. I use the clsChkList (it is great) in combination with Erel's TABLE class. I use them to display a SELECT query of 70000 records from 2 joined SQLite tables . The clsChkList selects the one to many table records by checking them all (250 records) and the TABLE class displays the 70000 records of the second table. Both tables have a common field (column). It takes 75 seconds for the records to appear in the grid. Would the ULV help me speed that up? If so, I will definitely purchase it.
Merci
 

Informatix

Expert
Licensed User
Longtime User
1. I think you are making a big mistake by not answering in this forum, because you are not showing your potential buyers what it can do.

My intent is not to hide something; it's just more convenient for me and my users. By email, I can exchange files with them and the exchange can last as long as needed. Moreover, since some of the users use my product in a commercial project, they can talk freely of their app with me.

Yes, the ULV will speed that up without any hesitation. The number of items doesn't really matter. BUT since data are loaded in real time, you would probably have to prepare your data before displaying the list (not sure, it depends on the complexity of your joined tables and the speed to retrieve each record). That may take a few seconds (a lot less than 75, and you can do it in the background if you wish; you can also save the result in a cache to reuse it later). I'll explain that to you after your first steps with the product.
 

HappyNurse

New Member
Licensed User
Longtime User
And another donation...

Thanks for creating this beautiful listview!
I just donated €25,- to you.

Marc
 

lalonja

New Member
Licensed User
Longtime User
Another donation

Hi,

I just donated EUR 25, how can I get the Ultimate listview?

thank you :sign0098:
 

airblaster

Active Member
Licensed User
Longtime User
Hi Informatix,

your library looks interesting.
Just wondering if you could post any code examples of how to use the library?
This would make it easier to understand the basics of the library.
 

Informatix

Expert
Licensed User
Longtime User
Hi Informatix,

your library looks interesting.
Just wondering if you could post any code examples of how to use the library?
This would make it easier to understand the basics of the library.

I prefer to not expose code here, but I can explain how it works basically:
1) you declare the different appearances (called layouts) of items;
2) you build a virtual list (all items are empty; it is needed to know the number of items and the layout of each one);
3) when requested in real time, you fill the item with views and content.

The library uses a more complex algorithm than the one in the Table class and builds its list in a more efficient way, but the main idea behind is similar.
 

airblaster

Active Member
Licensed User
Longtime User
Hi Informatix,

thanks for the outlining of the workflow.

One more question:
What are the licensing terms for ULV?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…