Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim sm As SlidingMenu
Dim IME As IME 'keyboard
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("Layout1")
sm.Initialize("sm")
Dim offset As Int = 100dip
sm.BehindOffset = offset
sm.Mode = sm.BOTH
Dim lv1 As ListView
lv1.Initialize("lv1")
For i = 1 To 10
lv1.AddSingleLine("Action " & i)
Next
sm.SecondaryMenu.AddView(lv1, 0, 0, 100%x - offset, 100%y)
Dim b1, b2 As Button
b1.Initialize("b1")
b2.Initialize("b2")
b1.Text = "Button1"
b2.Text = "Button2"
sm.Menu.AddView(b1, 10dip, 10dip, 100%x - offset - 20dip, 50dip)
sm.Menu.AddView(b2, 10dip, 60dip, 100%x - offset - 20dip, 50dip)
IME.Initialize("IME") 'keyboard
IME.AddHeightChangedEvent
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub lv1_ItemClick (Position As Int, Value As Object)
Log(Value)
sm.HideMenus
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK And sm.Visible Then
sm.HideMenus
Return True
End If
Return False
End Sub
Sub B1_Click
Log("b1_click")
sm.HideMenus
End Sub
Sub B2_Click
Log("b2 click")
sm.HideMenus
End Sub