B4A Library Swipe actions on both sides of xCustomListView

Discussion in 'Additional libraries, classes and official updates' started by Steve Kwok, Aug 14, 2019.

  1. Steve Kwok

    Steve Kwok Member Licensed User

    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.

    'inside CLVSwipe
    Public Sub CreateItemValue(Value As Object, lActions As List, rActions As ListAs SwipeItem
    Dim m As SwipeItem
        m.Value = Value
        m.leftActions = lActions
        m.rightActions = rActions
    Return m
    End Sub
    '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...

    Attached Files:

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice