'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim value1 As String
Dim value2 As String
Dim value3 As String
Dim value4 As String
Dim value5 As String
Dim value6 As String
Dim value7 As String
Dim timer1 As Timer
Dim disableCounter As Int
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.
Dim ScrollView1 As ScrollView
Dim seperator As Canvas
Dim p As Phone
Dim layoutVal As LayoutValues
Dim convertButton As Button
Dim dummyEdit As EditText
Dim editText1 As EditText
Dim editText2 As EditText
Dim editText3 As EditText
Dim editText4 As EditText
Dim editText5 As EditText
Dim editText6 As EditText
Dim editText7 As EditText
Dim label1 As Label
Dim label2 As Label
Dim label3 As Label
Dim label4 As Label
Dim label5 As Label
Dim label6 As Label
Dim label7 As Label
Dim labelTitle As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
timer1.Initialize("Timer1", 100)
End If
Dim y1, y2 As Float
Dim scrollViewHeight As Int
layoutVal = GetDeviceLayoutValues
If layoutVal.Width >= 480 Then
scrollViewHeight = 600
Else If layoutVal.Width >= 320 Then
scrollViewHeight = 550
End If
ScrollView1.Initialize2(DipToCurrent(scrollViewHeight), "ScrollView1")
ScrollView1.Panel.Width = 100%x
ScrollView1.Panel.Height = DipToCurrent(scrollViewHeight)
ScrollView1.Panel.LoadLayout("Main")
Activity.AddView(ScrollView1, 0, 0, 100%x, 30%y)
seperator.Initialize(ScrollView1.Panel)
editText1.ForceDoneButton = True
editText2.ForceDoneButton = True
editText3.ForceDoneButton = True
editText4.ForceDoneButton = True
editText5.ForceDoneButton = True
editText5.ForceDoneButton = True
editText6.ForceDoneButton = True
If FirstTime = True Then
value1 = "1"
value2 = "2"
value3 = "3"
value4 = "4"
value5 = "5"
value6 = "6"
value7 = "7"
End If
End Sub
Sub Activity_Resume
Dim x1, x2, y1 As Float
Dim layoutVal As LayoutValues
Dim scrollViewHeight As Int
Dim testPanel As Panel
layoutVal = GetDeviceLayoutValues
If layoutVal.Width >= 480 Then
scrollViewHeight = 600
Else If layoutVal.Width >= 320 Then
scrollViewHeight = 550
End If
ScrollView1.Panel.Height = DipToCurrent(scrollViewHeight)
x1 = 0
x2 = 100%x
y1 = (editText5.Top + editText4.Top + editText4.Height) / 2
seperator.DrawLine(x1, y1, x2, y1, Colors.White, 1)
editText1.ForceDoneButton = True
editText2.ForceDoneButton = True
editText3.ForceDoneButton = True
editText4.ForceDoneButton = True
editText5.ForceDoneButton = True
editText5.ForceDoneButton = True
editText6.ForceDoneButton = True
editText1.Text = value1
editText2.Text = value2
editText3.Text = value3
editText4.Text = value4
editText5.Text = value5
editText6.Text = value6
editText7.Text = value7
End Sub
Sub Activity_Pause (UserClosed As Boolean)
value1 = editText1.Text
value2 = editText2.Text
value3 = editText3.Text
value4 = editText4.Text
value5 = editText5.Text
value6 = editText6.Text
value7 = editText7.Text
End Sub
Sub EditText_FocusChanged (HasFocus As Boolean)
If HasFocus = True Then
Dim e As EditText
e = Sender
If timer1.Enabled = False Then
e.Text = ""
End If
End If
End Sub
Sub ScrollView1_ScrollChanged(Position As Int)
disableCounter = 3
If timer1.Enabled = False Then timer1.Enabled = True
End Sub
Sub Timer1_Tick
disableCounter = disableCounter - 1
If disableCounter <= 0 Then timer1.Enabled = False
End Sub