#Region Project Attributes
#ApplicationLabel: iosTypeSwitchView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
'#AdditionalRes: ..\LibRes
#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.
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 sv1 As SwitchView
Private Label1 As Label
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")
sv1.StateOffRightColor = Colors.White
sv1.StateOnLeftColor = Colors.Cyan
sv1.BigCircleInnerColor = Colors.Black
sv1.DisableBorderColor = Colors.Magenta
sv1.ShadowColor = Colors.White
sv1.BigCircleOutlineOffColor = Colors.Yellow
sv1.BigCircleOutlineOnColor = Colors.Magenta
Label1.Text = "OFF"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub sv1_switch_changed(checked As Boolean)
Log("state = " & checked)
If checked Then
Label1.Text = "ON"
Label1.TextColor = Colors.green
Else
Label1.Text = "OFF"
Label1.TextColor = Colors.red
End If
End Sub