Android Question How to add scroll up and scroll down function for CustomListView?

dragonguy

Active Member
Licensed User
Longtime User
i like to add scroll up and scroll down function to customlistview, but i don't know how to add?
please teach me how to do that.
Thanks!
 

dragonguy

Active Member
Licensed User
Longtime User
i add these code in to customlistview module
B4X:
Private Sub Panel_Touch (Action As Int, X As Float, Y As Float)
    Log("Action : " & Action & " , X :" & X)
   
    If Action=0 Then
        down=X
    else if Action=3 Then
        up=X   
        If down > up Then
            If SubExists(CallBack, EventName & "_ScrollDown") Then
                CallSub(CallBack, EventName & "_ScrollDown")
            End If
        Else   
            If SubExists(CallBack, EventName & "_ScrollUp") Then
                CallSub(CallBack, EventName & "_ScrollUp")
            End If
        End If
    End If
End Sub

but not stable at all.
 
Upvote 0

dragonguy

Active Member
Licensed User
Longtime User
if i change to
B4X:
Private Sub Panel_Touch (Action As Int, X As Float, Y As Float)
    Log("Action : " & Action & " , X :" & X)
   
    If Action=0 Then
        down=X
    else if Action=3 Then
        up=X   
        If down >= up Then
            If SubExists(CallBack, EventName & "_ScrollDown") Then
                CallSub(CallBack, EventName & "_ScrollDown")
            End If
        Else   
            If SubExists(CallBack, EventName & "_ScrollUp") Then
                CallSub(CallBack, EventName & "_ScrollUp")
            End If
        End If
    End If
End Sub

more stable now.
 
Upvote 0

tzfpg

Active Member
Licensed User
Longtime User
I have try your code scroll up and down. It can be used but item click or long click cannot function.
Still not stable.
 
Upvote 0
Top