#Region Project Attributes
#ApplicationLabel: b4aNewCompassView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#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 ncv1, ncv2, ncv3 As NewCompassView
Private mbm1, mbm2, mbm3 As Bitmap
Private bmd1, bmd2, bmd3 As BitmapDrawable
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")
mbm1.Initialize(File.DirAssets, "ic_needle_2.png")
bmd1.Initialize(mbm1)
ncv1.DegreesColor = Colors.Yellow
ncv1.BorderColor = Colors.White
ncv1.DegreeValueColor = Colors.Red
ncv1.OrientationLabelsColor = Colors.Magenta
ncv1.ShowBorder = True
ncv1.ShowDegreeValue = True
ncv1.ShowOrientationLabels = True
ncv1.DegreesStep = 5
ncv1.Needle = bmd1
'second compass
mbm2.Initialize(File.DirAssets, "ic_needle_1.png")
bmd2.Initialize(mbm2)
ncv2.DegreesColor = Colors.Cyan
ncv2.BorderColor = Colors.Green
ncv2.DegreeValueColor = Colors.White
ncv2.OrientationLabelsColor = Colors.Blue
ncv2.ShowBorder = True
ncv2.ShowDegreeValue = True
ncv2.ShowOrientationLabels = True
ncv2.DegreesStep = 15
ncv2.Needle = bmd2
'third compass
mbm3.Initialize(File.DirAssets, "ic_needle.png")
bmd3.Initialize(mbm3)
ncv3.DegreesColor = Colors.White
ncv3.BorderColor = Colors.White
ncv3.DegreeValueColor = Colors.White
ncv3.OrientationLabelsColor = Colors.White
ncv3.ShowBorder = True
ncv3.ShowDegreeValue = True
ncv3.ShowOrientationLabels = False
ncv3.DegreesStep = 45
ncv3.Needle = bmd3
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ncv1_sensor_changed(value As Double)
Log("Compass 1 = " & value)
End Sub
Sub ncv2_sensor_changed(value As Double)
Log("Compass 2 = " & value)
End Sub
Sub ncv3_sensor_changed(value As Double)
Log("Compass 3 = " & value)
End Sub