Sub Globals
Dim pnl As Panel
Dim g As Gestures
Dim cvs As Canvas
Dim SeekBarsColors() As Int
SeekBarsColors = Array As Int(Colors.Yellow, Colors.Blue)
End Sub
Sub Activity_Create(FirstTime As Boolean)
pnl.Initialize("")
Activity.AddView(pnl, 0, 0, 100%x, 100%y)
g.SetOnTouchListener(pnl, "Pnl_GesturesTouch")
cvs.Initialize(pnl)
End Sub
Sub Pnl_GesturesTouch(View As Object, PointerID As Int, Action As Int, x As Float, Y As Float) As Boolean
For i = 0 To g.GetPointerCount - 1
Dim x, y As Float
x = g.GetX(i)
y = g.GetY(i)
If y > 100dip AND y < 200dip Then
DrawSeekBar(0, x)
Else If y > 200dip AND y < 300dip Then
DrawSeekBar(1, x)
End If
Next
Return True
End Sub
Sub DrawSeekBar(SeekBarNum As Int, X As Float)
Dim r As Rect
r.Initialize(0, 100dip + SeekBarNum * 100dip, 100%x, 100dip + SeekBarNum * 100dip + 100dip)
cvs.DrawRect(r, Colors.Black, True, 0)
pnl.Invalidate2(r)
r.Right = X
cvs.DrawRect(r, SeekBarsColors(SeekBarNum), True, 0)
End Sub