B4A Library SwipeToDismiss any View

DonManfred

Expert
Licensed User
SwipeToDismiss
Version:
1

  • Methods:
    • onTouch (view As View, motionEvent As MotionEvent) As Boolean
  • SwipeToDismiss
    Events:
    • ondismiss (tag As Object)
    Methods:
    • Initialize (EventName As String, v As View, tag As Object)

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim s2d As SwipeToDismiss
    Private Button1 As Button
    Private ImageView1 As ImageView
    Private Panel1 As Panel
    Private ToggleButton1 As ToggleButton
    Private ScrollView1 As ScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    s2d.Initialize("SwipeToDismiss",Button1,"Button")
    s2d.Initialize("SwipeToDismiss",ImageView1,"Button")
    s2d.Initialize("SwipeToDismiss",Panel1,"Panel")
    s2d.Initialize("SwipeToDismiss",ScrollView1,"SV")
    s2d.Initialize("SwipeToDismiss",ToggleButton1,"Toggle")
End Sub
Sub SwipeToDismiss_ondismiss(tag As Object)
    Log("SwipeToDismiss("&tag&")")
End Sub
 

Attachments

Top