Android Question Grid with list of imageNames

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello team,

I am trying to implement @Erel 's grid at my project.

I have a question about my case.



B4X:
Sub CustomListView1_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)

    For Each i As Int In PCLV.VisibleRangeChanged(FirstIndex, LastIndex)

        Dim item As CLVItem = CustomListView1.GetRawListItem(i)

        Dim pnl As B4XView = xui.CreatePanel("")

        item.Panel.AddView(pnl, 0, 0, item.Panel.Width, item.Panel.Height)

        Dim data As MyImageData = item.Value

        'Create the item layout

        pnl.LoadLayout("item")

        For x = 0 To 3

            pnl.GetView(x).GetView(1).Text = data.IndexOfFirstImage + x

            DownloadAndSetImage($"https://picsum.photos/id/${data.IndexOfFirstImage + x}/200/300.jpg"$, pnl.GetView(x).GetView(0).Tag) 'https://www.b4x.com/android/forum/threads/117992/#content

        Next

    Next

End Sub



As we see at example, you get the index of first image and you fetching this and three more images. It's ok, because you want to fetch, lets say 300 photos in order.



Now, my question is that if i have a list of imageNames that i want to fetch from a server(not numbers from 1 to 300) how this could be done?



Thank you for your time.
 
Top