Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim IME As IME
Dim btnRun As Button
Dim chkBreak As CheckBox
Dim chkStep As CheckBox
Dim edtSource As EditText
Dim btnLineNum As Button
Dim lblLine As Label
Dim chkWrap As CheckBox
Private chkShrink As CheckBox
Private chkSideBySide As CheckBox
Private ActivityHeight As Int
Private ActivityHeightSet As Boolean
End Sub
#Region Activity Events
Sub Activity_Create(FirstTime As Boolean)
IME.Initialize("IME")
IME.AddHeightChangedEvent
ActivityHeight = 100%y
If FirstTime = False Then
Sleep(500)
End If
ActivityHeightSet = True
Activity.Height = ActivityHeight
Activity.LoadLayout("Layout")
edtSource.Color = Colors.White ' this hides the horizontal line at the bottom of the EditText
Dim jo As JavaObject
' keep edtSource visible in landscape
jo = edtSource
jo.RunMethod("setImeOptions", Array(33554432)) ' IME_FLAG_NO_FULLSCREEN
edtSource.Wrap = False
End Sub
Sub Activity_Pause (UserClosed As Boolean)
IME.HideKeyboard
End Sub
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
Log("HeightChanged: " & NewHeight)
If ActivityHeightSet = False Then
Log("Setting activity height: " & NewHeight)
ActivityHeight = NewHeight
End If
End Sub