B4A Library SwipeToDismiss any View

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Mar 10, 2015.

  1. DonManfred

    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)

    Code:
    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
     

    Attached Files:

Loading...
  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