Android Question Scroll left and right

anallie0

Active Member
Licensed User
Longtime User
Hello
I have a panel with a ScrollView. Inside the ScrollView I have a label and a imageview.
I would use the example of Erel.
B4X:
Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean 'Return True to consume the event
   Select Action
      Case Activity.ACTION_DOWN
         StartX = X
      Case Activity.ACTION_UP
         If Abs(X - StartX) > MOVEMENT_THRESHOLD Then
            Swipe(X < StartX)
         End If
   End Select
   Return True     
End Sub

Sub Swipe(Left As Boolean)
   If Left Then Msgbox("Left", "") Else Msgbox("Right", "")
End Sub

I applied to the panel but can not make it work. I tried to apply it to imageview but nothing. This event I just need to change the text and the image.
 
Top