Android Question Swipe left/right panel

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello my friends,
I would like my panel handle swipe left AND right event. How is that possible to be done? (i 've searched at forum, there are libraries, but only to dismiss that view or show a menu)
Thank you in advance.
 

yiankos1

Well-Known Member
Licensed User
Longtime User
B4X:
Private minDistance As Int = 150
Private x1,x2 As Float
Sub pnlPhoto_Touch (Action As Int, X As Float, Y As Float)
    Select    Action
        Case 0
            x1 = x
        Case 1
            x2 = x
            Private deltaX = x2 - x1
            If Abs(deltaX) > minDistance Then
                If x2 > x1 Then
                    ToastMessageShow("Left to right",False)
                Else
                    ToastMessageShow("Right to left",False)
                End If
            End If
    End Select
End Sub

I figured it out! Thank you for your time.
 
Upvote 0
Top