Android Question [B4X] BitmapsAsync Grid specific image click event

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello team,

I am trying to implement @Erel 's grid at my project. I would like to know if i can get a specific B4XImageView click event, in order to get data "behind" that image.

To conclude there is no click event for B4XImageView. Can it be added?

Thank you for your time.
 
Last edited:

yiankos1

Well-Known Member
Licensed User
Longtime User
Handle the click events of the four panels.
Thank you for your answer Erel.
I am testing your example and i have to admin that is very responsive and quick loading.

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 your 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.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…