#Region Project Attributes
#ApplicationLabel: Bateria
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: True
#End Region
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim bumbos,tarols,chipos As Int
Dim sp As SoundPool
Private chipo As Button
Dim g As Gestures
Dim Panel2 As Panel
Dim Panel3 As Panel
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("1")
Panel2.Initialize("Panel2")
Panel2.Color = Colors.LightGray
Panel2.Tag = "Panel2"
Panel3.Initialize("Panel3")
Panel3.Color = Colors.LightGray
Panel3.Tag = "Panel3"
'Panel3.Initialize("Panel3")
g.SetOnTouchListener(Panel2, "Panel2_GesturesTouch")
g.SetOnTouchListener(Panel3, "Panel3_GesturesTouch")
' g.SetOnTouchListener(Panel3, "Panel3_GesturesTouch")
Activity.AddView(Panel2, 5%x, 5dip, 10%y, 310dip)
Activity.AddView(Panel3, 20%x, 5dip, 10%y, 310dip)
sp.Initialize(50)
bumbos = sp.Load(File.DirAssets, "bumbo.mp3")
tarols = sp.Load(File.DirAssets, "tarol.mp3" )
chipos = sp.Load(File.DirAssets, "chipo.mp3" )
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Panel2_GesturesTouch(o As Object, ptrID As Int, action As Int, x As Float, y As Float) As Boolean
sp.Play(bumbos ,1,1,1,0,1 )
'Return True ' need to return true otherwise we don't get any other events in the gesture
End Sub
Sub Panel3_GesturesTouch(o As Object, ptrID As Int, action As Int, x As Float, y As Float) As Boolean
sp.Play(tarols ,1,1,2,0,1 )
'Return True ' need to return true otherwise we don't get any other events in the gesture
End Sub
Sub bumbo_Click
sp.Play(bumbos ,1,1,2,0,1 )
End Sub
Sub tarol_Click
sp.Play(tarols ,1,1,2,0,1 )
End Sub
Sub chipo_Click
sp.Play(chipos ,1,1,2,0,1 )
End Sub