B4A Library [Lib] UltimateListView

Bryanne Vega

Member
Licensed User
Longtime User
On the swipe demo (scrolling), do you have available something like pagination?

(When scrolling left or right, stop at the next page instead of continuously slide to the other page if not stopped, sort of like when you're browsing you apps in the app dash board on your phone)
 

Informatix

Expert
Licensed User
Longtime User
I don't understand what you mean by "Next page" in the context of the demo. Maybe AHViewPager will suit your needs.
 

JordiCP

Expert
Licensed User
Longtime User
Hi Fred,

I am using your ULV with two different layouts: "Headers" and "Items": the first element is always a "Header", then some items, then another header, and so on....
Also, I am using Drag when there is a LongClick event to move "Items" within the list. It works perfect!!

if I drag one item to the first position, of course it allows me to do it. But I would like to prevent this, since it will result in having an item before the first header, which in my app does not make sense.
I know it can be done by checking the position in the Drop event and correcting it if needed.
But (just in case I am missing it) is there any other way to prevent it in advance? I mean, not letting the user drag to certain positions?

Thanks in advance!
 

Prosg

Active Member
Licensed User
Longtime User
Hello,

I want to change the height of LayoutPanel dynamicly

I need to change in the sub

B4X:
Sub Item_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)

how can i do this ?

I test

B4X:
Dim monPanel As Panel = LayoutPanel
    monPanel.Height = 500dip

but error

java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.ViewParent.requestLayout()' on a null object reference
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Please read the post just before yours.
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Fred. Before you leave for the holidays i have one question:



I have this ULV, when i click about "Like" (1) i have +1 as Points ( points is label in ULV ) . It is possible without reload all ULV that i have label Point update ?
Example now you see first picture "1 Points" in label color orange. Now if i click about Like (1) i want see (whitout reload all ULV) "2 Points".

The code is:
B4X:
....
Sub Item_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
   
.......
 
    Dim lbl_punti As Label =  LayoutPanel.GetView(4)
    lbl_punti  =  LayoutPanel.GetView(4)
    lbl_punti.Typeface = FA.FontAwesomeTypeface
    lbl_punti.TextColor = Colors.White
        If preleva.Get("log_punteggio" & Position) = 0 Then
            lbl_punti.Text = "0  Points"
        Else
            lbl_punti.Text = preleva.Get("log_punteggio" & Position) & " " &  " Points  "
        End If
.......
End Sub
 
 
'Click Like
Sub imageview3_Click
   
    Dim imageview3 As ImageView = Sender
    Dim foto_id As Int =  preleva.Get("log_id" & imageview3.Tag)
    Starter.scelta_id_foto = foto_id
 
    'Check if pictures is already Vote
    db.QueryASync("select * from dario_fotolike where id_customers = "& Starter.id_customers &" and id_foto = "&Starter.scelta_id_foto &";", "Riporta_Dati2")   
 
End Sub

Thank you
Marco
 

johndb

Active Member
Licensed User
Longtime User
I would use ulv.RefreshContent as it will only reload the visible items.
 

MarcoRome

Expert
Licensed User
Longtime User
I would use ulv.RefreshContent as it will only reload the visible items.
Thank John. But RefreshContent isnt sufficient in this cases. Because "reload" items as in original. But dont change value
 

JordiCP

Expert
Licensed User
Longtime User
Thank John. But RefreshContent isnt sufficient in this cases. Because "reload" items as in original. But dont change value

I would also use RefreshContent.

If I understood correctly your code (sorry if I am wrong), you get the current votes from "preleva" map, and that is what you use in Item_ContentFiller Sub

So, if you update this preleva map with the new points before calling RefreshContent, the Item_ContentFiller calls will fill the label with the desired updated values

It can be done in the same event if you have this data in memory, or if you need to update it from a DB with an async query, do the call to Refreshcontent when the results are available
 

MarcoRome

Expert
Licensed User
Longtime User
Right JordiCP work in great mode.
Thank you for your suggestion and GREAT YEAR 2016
 

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Fred,

I accidentally deleted my copy of ULV and have proof of my donation.

Can you send me an email with the current version I can download?

Thanks.

Truly,
Richard Leiman
 

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
I'd like to change the color of the keys when the user clicks on one of them. Example where I click the button turns green the other blacks.
I have this layout:


and this is result:


My code is:

B4X:
Sub Item_LayoutCreator(LayoutName As String, LayoutPanel As Panel)
            LayoutPanel.LoadLayout("lay_strumenti")            
End Sub


Sub Item_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)

    Dim imageview1 As ImageView = LayoutPanel.GetView(0)
    'First view in the panel
    imageview1.Gravity = Gravity.FILL
    Dim immagine As Bitmap
    immagine.Initialize(File.DirAssets, "sc_3.jpg" )
    imageview1.Bitmap = immagine

    Dim Label1 As Label =  LayoutPanel.GetView(1)
    Label1.Text =  risposte.Get("log_id_domanda" & Position)
    Label1.Tag =  risposte.Get("log_id_domanda" & Position)
   
    Dim Button1 As Button = LayoutPanel.GetView(2)
   
        Button1.Text = risposte.Get("log_risposta_a" & Position)
        Button1.Tag = risposte.Get("log_risposta_a" & Position)


   
    Dim Button2 As Button = LayoutPanel.GetView(3)
        Button2.Text = risposte.Get("log_risposta_b" & Position)
        Button2.Tag = risposte.Get("log_risposta_b" & Position)


   
    Dim Button3 As Button = LayoutPanel.GetView(4)
        Button3.Text = risposte.Get("log_risposta_c" & Position)
        Button3.Tag = risposte.Get("log_risposta_c" & Position)


End Sub

Sub Button1_Click
    Dim Button1 As Button = Sender
    Dim dove_mitrovo As String = Button1.Tag
    ToastMessageShow( dove_mitrovo , True)
    Dim splitta() As String = Regex.Split("\|", Button1.Tag)
    primopezzo = splitta(0)
    secondopezzo = splitta(1)
    punti = splitta(2)
    Button1.TextColor = Colors.Black
    'Do la rotondità e cornice
    Dim c2, c3 As ColorDrawable
    c2.Initialize2(Colors.ARGB(255, 39, 255, 0),10dip,3dip,Colors.Black)
    Button1.Background = c2
   
End Sub

Any idea ?
Thank you
Marco
 

Informatix

Expert
Licensed User
Longtime User
For the last time: there's no support in this forum for ULV.
I see no reason to expose here the numerous errors of programming of my donors (like in the post above). Moreover I have many requests a day. I would not be able to handle them in a single thread or exchange private code in the forum. I want to keep this thread for public announcement and questions of people interested by ULV.
 

MarcoRome

Expert
Licensed User
Longtime User
Ok Fred dont worry ... is last time that i expose here my numerous errors . I got it that you want keep this thread for public announcement... the next time i send only way email
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…