#Region Project Attributes
#ApplicationLabel: ProgressRoundButton
#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, t1 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 prb1 As ProgressRoundButton
Private cnt As Int = 0
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", 100)
t1.Initialize("t1", 1000)
prb1.BackgroundColor = Colors.Blue
prb1.BackgroundSecondColor = Colors.Green
prb1.ButtonRadius = 15.0
prb1.TheTextSize = 25.0
prb1.CurrentText = "START LOADING DATA"
prb1.MinProgress = 0
prb1.MinProgress = 100
prb1.Progress = 0
prb1.TextColor = Colors.Red
prb1.TextCoverColor = Colors.LightGray
prb1.State = 0
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub t_tick
cnt = cnt + 1
If cnt < 101 Then
prb1.Progress = cnt
Else
cnt = 0
t.Enabled = False
prb1.CurrentText = "PROCESSING DATA"
prb1.State = 2
t1.Enabled = True
End If
End Sub
Sub t1_tick
cnt = cnt + 1
If cnt = 5 Then
t1.Enabled = False
cnt = 0
prb1.CurrentText = "START LOADING DATA"
prb1.State = 0
End If
End Sub
Sub prb1_button_clicked
Log("Button prb1 clicked")
prb1.State = 1
prb1.CurrentText = "BUSY LOADING DATA"
t.Enabled = True
End Sub