Hi
I have at CustomerListView (horisontal) containg 4 images. I can swipe them horisontally - so far so good.
But I'd like to add some "gravity", so when I swipe a images halfway - the gravity takes over at swipe the image the rest of the way
How do I do that?
B4X:
clvProfilePictures.Add(CI(clvProfilePictures.AsView.width, clvProfilePictures.AsView.Height, $"This is item #${i}"$, bitmaps.Get(i)),"")
.
.
.
private Sub CI(w As Int, h As Int, t As String, image As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, w, h)
p.LoadLayout("cardProfile")
lblProfileLabel.Text=t
imgProfileCard.setBitmap(xui.LoadBitmapResize(File.DirDocuments, image, w,h,False))
Return p
End Sub
SnapCLV is a very simple class that adds a "snap" feature to xCLV in vertical mode. When the user stops scrolling the list the list scrolls to the nearest item so the top item will not be partially hidden. It is compatible with B4A, B4i and B4J Note that you need to call snap.ScrollChanged...