#Region Project Attributes
#ApplicationLabel: NiceSpinner
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#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.
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 ns1, ns2 As NiceSpinner
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")
ns1.Initialize("ns1")
ns2.Initialize("ns2")
Activity.AddView(ns1, 20%x, 5%y, 20%x, 10%y)
Activity.AddView(ns2, 60%x, 5%y, 20%x, 10%y)
Dim r1 As List
r1.Initialize
r1.AddAll(Array As String("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve"))
Dim divcolor() As Int = Array As Int(Colors.Blue, Colors.Green, Colors.Red)
ns1.DividerColor = divcolor
ns1.DividerHeight = 1
ns1.DropdownListBackgroundColor = Colors.LightGray
ns1.attachDataSource(r1)
ns1.DropdownListTextColor = Colors.DarkGray
'the next two lines of code must be before ns1.SelectedIndex is set
ns1.SelectedTextColor = Colors.Green
ns1.SelectedTextBackgroundColor = Colors.White
'always set this even if just to 0
ns1.SelectedIndex = 0
Dim r2 As List
r2.Initialize
r2.AddAll(Array As String("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"))
Dim divcolor() As Int = Array As Int(Colors.White, Colors.White, Colors.White)
ns2.DividerColor = divcolor
ns2.DividerHeight = 2
ns2.DropdownListBackgroundColor = Colors.Black
ns2.attachDataSource(r2)
ns2.DropdownListTextColor = Colors.White
'the next two lines of code must be before ns2.SelectedIndex is set
ns2.SelectedTextColor = Colors.White
ns2.SelectedTextBackgroundColor = Colors.DarkGray
'always set this even if just to 0
ns2.SelectedIndex = 2
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ns1_item_clicked
Log("ns1 item " & ns1.SelectedIndex &" selected")
End Sub
Sub ns2_item_clicked
Log("ns2 item " & ns2.SelectedIndex &" selected")
End Sub