Android Question xCustomListView

Josias

Member
Licensed User
Longtime User
Hi All,

Can anyone tell me if the following can be done with xCustomListView:
I need 3 columns
In the first there will be an image such as settings
The second column will have Text. The top line is a heading (bold - centered), the second and 3rd line will contain text - typically a description.
The third column will typically have a switch to enable / disable something

Are there any examples? Note that I need it for both Android and iOS.

Feedback will be appreciated.
 

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi Josias,

Create another layout with the views that you need inside a "panel" and then "generate members" in your "activity".

upload_2019-12-3_22-51-24.png


Then add this views to your xCustomListView


B4X:
            '
            cmp_clv_Movim.Add(Create_Item_Movim(lcFecha, lcOperacion, lcPuntos, lcSaldo, lcHeight, lcWidth), lcMensaje)


B4X:
Sub Create_Item_Movim (Par_Fecha As String, Par_Operacion As String, Par_Puntos As Double, Par_Saldo As Double, Par_Height As Int, Par_Width As Int) As Panel
    Dim p As B4XView = xui.CreatePanel("")
    '
    p.SetLayoutAnimated(0, 0, 0, Par_Width, Par_Height)
    p.LoadLayout("Movim_Puntos")
    '
    mp_lb_Fecha.Text        = Par_Fecha.SubString2(0,10)
    mp_lb_Operacion.Text    = Par_Operacion
    mp_lb_Puntos.Text        = NumberFormat2(Par_Puntos,1,2,2,True)
    mp_lb_Saldo.Text        = NumberFormat2(Par_Saldo,1,2,2,True)
    '
    If Par_Operacion = "-" Then
        mp_lb_Fecha.TextColor        = Colors.Red
        mp_lb_Operacion.TextColor    = Colors.Red
        mp_lb_Puntos.TextColor        = Colors.Red
        mp_lb_Saldo.TextColor        = Colors.Red
    End If
    '
    Return p
End Sub

I hope it is useful for you

Regards,

Edgar
 
Upvote 0

Josias

Member
Licensed User
Longtime User
Thnx Edgar,

After looking at your code, looking at the attached image and playing with the code I've managed to sort it out. It was a lack of understanding on my side.
 
Upvote 0
Top