If i create dinamically scrollview, how do i return a click event from current pressed img or button?
B4X:
For i1 = 0 To 5
Dim img As ImageView
img.Initialize("img")
img.Gravity=Gravity.FILL
img.Bitmap=LoadBitmap(File.DirAssets , "image.webp")
Dim pnl As HorizontalScrollView
pnl.Initialize(500dip,"scroll"&i)
pnl.Panel.Initialize("")
appscrollpnl.Panel.AddView(pnl,10dip,topanel, Activity.Width - 20dip, 80dip)
pnl.Panel.Width=480dip
pnl.Width=Activity.Width-20dip
pnl.Panel.AddView(img,left,0,80dip,80dip)
left=left + 80dip
Next
i want to do a sub that return the currently clicked, for ex the imgview pressed event for the pressed img.
or set another properties to imgview pressed by the event.
i was thinking doing a shared sub like
B4X:
Sub img_Click()
Self.width(300dip) or this.width(300dip) or sender.width(300dip)
End
Thanks @DonManfred, its working like charm, i haven't read the documentation, i work with too much programming languages.
Also im using your Stickers4Whats lib, its very good work,
this script generates dynamically the sticker packs, first, it reads the JSON file, then creates a horizontalscrollview with 6 images in pack + add to wa button for every sticker pack, i was working on this all day.
How are you doing to show the sticker packs in app?