B4A Library Swipe actions on both sides of xCustomListView

Referring to: https://www.b4x.com/android/forum/threads/b4x-clvswipe-xcustomlistview-swipe-actions-and-pull-to-refresh.98252/ ,
I have edited class CLVSwipe of downloaded sample B4A_CLVSwipe.zip to function swiping both sides.

Since the swipe process left and right menu, it is initialized/created by inputing both menu item in form of list.

B4X:
'inside CLVSwipe
Public Sub CreateItemValue(Value As Object, lActions As List, rActions As List) As SwipeItem
    Dim m As SwipeItem
    m.Initialize
    m.Value = Value
    m.leftActions = lActions
    m.rightActions = rActions
    Return m
End Sub

B4X:
'inside Main
CustomListView1.AddTextItem(cs, Swipe.CreateItemValue("", _
                Array("A1", "A2", "A3"), Array("Action 1", "Action 2", "Action 3")))

The ChangeOffset, CreateActionButtons are duplicated to generate left and right menu.

I did not changed the B4i codes because I developed Android only.

Hope that improvement is helpful!!!

Demo swipe

Left buttons...


Right buttons...
 

Attachments

  • B4A_CLVSwipe_BothSides_190814.zip
    25.9 KB · Views: 418
Cookies are required to use this site. You must accept them to continue using the site. Learn more…