#Region Project Attributes
#ApplicationLabel: TrackingRingView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim t As Timer
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.
Private trv1, trv2 As TrackingRingView
Dim progval1(4) As Int
Dim progvaltext1(4) As String
Dim mytime(3) As Int
Dim mytimetext(3) As String
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("main")
t.Initialize("t", 10)
progval1(0) = 25
progvaltext1(0) = progval1(0)
progval1(1) = 38
progvaltext1(1) = progval1(1)
progval1(2) = 63
progvaltext1(2) = progval1(2)
progval1(3) = 79
progvaltext1(3) = progval1(3)
trv1.NumberOfRings = 4
trv1.RingColors = Array As Int(Colors.Green, Colors.Yellow, Colors.Red, Colors.Blue)
trv1.RingBackgroundColors = Array As Int(Colors.LightGray, Colors.White, Colors.LightGray, Colors.White)
trv1.StartAngle = 0
trv1.AnimationDuration = 0
trv1.RingTextColor = Colors.black
trv1.RingText = progvaltext1 'lets give it a kickstart else the pic looks dull
trv1.RingProgressValues = progval1 'lets give it a kickstart else the pic looks dull
trv1.ConfigureRings
trv2.NumberOfRings = 3
trv2.RingColors = Array As Int(Colors.Green, Colors.Red, Colors.Yellow)
trv2.RingBackgroundColors = Array As Int(Colors.White, Colors.LightGray, Colors.White)
trv2.StartAngle = -90
trv2.AnimationDuration = 0
trv2.RingTextColor = Colors.Black
End Sub
Sub Activity_Resume
t.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
t.Enabled = False
End Sub
Sub t_tick
progval1(0) = progval1(0) + 1
progvaltext1(0) = progval1(0)
If progval1(0) = 100 Then
progval1(0) = 0
progval1(1) = progval1(1) + 1
progvaltext1(1) = progval1(1)
If progval1(1) = 100 Then
progval1(1) = 0
progval1(2) = progval1(2) + 1
progvaltext1(2) = progval1(2)
If progval1(2) = 100 Then
progval1(2) = 0
progval1(3) = progval1(3) + 1
progvaltext1(3) = progval1(3)
If progval1(3) = 100 Then
progval1(3) = 0
End If
End If
End If
End If
trv1.RingText = progvaltext1
trv1.RingProgressValues = progval1
trv1.ConfigureRings
mytime(0) = DateTime.GetSecond(DateTime.Now)
mytime(0) = (100/60) * mytime(0)
mytimetext(0) = DateTime.GetSecond(DateTime.Now)
mytime(1) = DateTime.GetMinute(DateTime.Now)
mytime(1) = (100/60) * mytime(1)
mytimetext(1) = DateTime.GetMinute(DateTime.Now)
mytime(2) = DateTime.GetHour(DateTime.Now)
mytime(2) = (100/60) * mytime(2)
mytimetext(2) = DateTime.GetHour(DateTime.Now)
trv2.RingText = mytimetext
trv2.RingProgressValues = mytime
trv2.ConfigureRings
End Sub