Android Question BitmapsAsync Grid specific image click event: I need an example

As already requested by yiankos1, I too would like to capture the click events of each image. As indicated by Erel BitmapsAsync Grid specific image click event
I created an event for each Image, unfortunately the only thing I can get is the click on the panel but not the one related to the image, how to do it?
Thanks
 
Upvote 0
1. Your question has nothing to do with BitmapsAsync. BitmapsAsync is just responsible for loading bitmaps.
2. Don't use BitmapsAsync. Use SimpleMediaManager instead.

A modified version of SMM_Example2 is attached. It handles the click event (B4A only - should be trivial to make same changes in layout in B4J and B4i).
 

Attachments

Upvote 0
1. Your question has nothing to do with BitmapsAsync. BitmapsAsync is just responsible for loading bitmaps.
2. Don't use BitmapsAsync. Use SimpleMediaManager instead.

A modified version of SMM_Example2 is attached. It handles the click event (B4A only - should be trivial to make same changes in layout in B4J and B4i).
Considering that the bread in B4J, unlike the B4A panel does not have the click event, I used this code that works. Is there a better way? If no one answers then it means this is the only way.

Code: Copy
#if B4A
Private Sub pnlImage_Click
    Dim ImageIndex As Int = Sender.As(B4XView).Tag
    Log($"Clicked on image: ${ImageIndex}"$)
End Sub
#else

Private Sub pnlImage_MouseClicked (EventData As MouseEvent)
    Dim ImageIndex As Int = Sender.As(B4XView).Tag
    Log($"Clicked on image: ${ImageIndex}"$)
End Sub
#end if
 
Upvote 0
Back
Top