Sub Globals
Private vb1 As ValueBar
Private vb2 As ValueBar
Private vb3 As ValueBar
Private t1 As Timer
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")
vb1.Textformat = "###,###,##0"
vb1.Color = Colors.Red
vb1.OverlayColor = Colors.Blue
vb1.BackgroundColor = Colors.LightGray
vb1.DrawBorder = True
vb1.Interval = 10
vb1.setMinMax(0,100)
vb1.animate(0,80,5000)
vb1.Tag = 1
vb2.Textformat = "###,###,##0.0"
vb2.Color = Colors.Red
vb2.OverlayColor = Colors.Green
vb2.BackgroundColor = Colors.LightGray
vb2.DrawBorder = True
vb2.Interval = 10
vb2.setMinMax(0,10)
vb2.animate(0,7.5,1000)
vb1.Tag = 2
vb3.Textformat = "###,###,##0.00"
vb3.OverlayColor = Colors.Yellow
vb3.BackgroundColor = Colors.DarkGray
vb3.DrawBorder = True
vb3.Interval = 10
vb3.setMinMax(0,100)
vb3.animate(0,69.95,1000)
vb3.Tag = 3
t1.Initialize("timer",2000)
t1.Enabled = True
End Sub
Sub timer_tick
If vb3.Value < (vb3.Max/2) Then
Dim rndNum As Int = Rnd(50, 101)
vb3.animateUp(rndNum,1000)
Else
Dim rndNum As Int = Rnd(0, 50)
vb3.animateDown(rndNum,1000)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub vb_onselectionupdate(val As Float, maxval As Float, minval As Float, tag As Object)
Log("vb_onselectionupdate(bar "&tag&","&val&","&maxval&","&minval&")")
End Sub