Android Question [B4X] [XUI] SD XUIView2 - on GridView how to use own layouts design?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I am interested in the XgridView XgridListView layout however to use own defined layouts. For example, I need a layout with two images to indicate some KPI and some text, around 4 items actually?

Thanks

Edit: These are some variants of the "item". I guess this is due to a "pre-defined" layout per item. Is it possible for one to create and use their own layout variant so that each item meets their own specific design?

1631575865443.png


These are created by calling .Add / .AddWithImage etc. As an example, with the customlistview, one can create their own layout per item, using this kind of approach.

B4X:
Sub CreateItem(?, ?)
Dim p As B4XView = xui.CreatePanel("")
    p.Height = height
    p.Width = width
    p.Top = 0
    p.Left = 0
    p.LoadLayout("eachdevice")
blah blah blah
End Sub

And add items like...

B4X:
For Each entry As Map In dbUser.result
        lstDevices.Add(CreateItem(lstDevices.AsView.Width, 100dip, entry), sdeviceid)
    Next

How can one achieve the same, using their own layouts per item to meet their own specific design per item? I hope its clear.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Hi there

I am interested in the XgridView layout however to use own defined layouts. For example, I need a layout with two images to indicate some KPI and some text, around 4 items actually?

Thanks
Sorry but I didn't understand the question.

I don't even understand if you are talking about xGridListView
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Now I get it, you want something like xCustomListView.

Honestly, I have never considered it a good thing to leave the freedom to insert a custom Layout, this exposes you to errors, problems and often the resulting layout is unpleasant to see.
I preferred to create a List that, regardless of the developer's skills, was functional and pleasant. In fact, in the background there is a fading color effect and many other small graphic and animation details that make it always and in any case elegant.
This could not be guaranteed if you allowed to customize the layouts

In any case I will see if it will be possible to implement it in one of the next updates. The class has a particular structure to allow animations and graphic effects, so it could be complicated to add your request. For this reason I do not guarantee that it can be done.
 
Upvote 0
Top