Sub Class_Globals
Private ACToolBarLight1 As ACToolBarLight
Private ToolbarHelper As ACActionBar
Private MenuIcon As BitmapDrawable
Private SMenu As SlidingMenu
Private MenuItems As ListView
Private Menus As List
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
'Menu Part
Dim LeftPanel As Panel = Generate_Menu
Menus.Initialize
Menus.AddAll(Array As String(Login.Name, "BMR" , "Logout"))
For i=0 To Menus.Size-1
MenuItems.AddSingleLine(Menus.Get(i))
Next
MenuItems.Color = Colors.DarkGray
End Sub
Sub ACToolBarLight1_NavigationItemClick
SMenu.ShowMenu
End Sub
Sub Logout_Click
Sign_Out
End Sub
Sub MenuItems_ItemClick (Position As Int, Value As Object)
Dim mnu As String = Menus.Get(Position)
If mnu = "Logout" Then
Logout_Click
End If
If mnu = "BMR" Then
StartActivity(BMR)
End If
End Sub
Sub CloseActivities
Dim jo As JavaObject
jo.InitializeContext
jo.RunMethod("finishAffinity", Null)
End Sub
Sub Sign_Out
CallSub(Backendless, "Sing_Out")
Login.Google.SignOutFromGoogle
Login.Facebook.SignOut
CloseActivities
End Sub
Sub Generate_Menu As Panel
MenuIcon.Initialize(LoadBitmap(File.DirAssets, "hamburger.png"))
ToolbarHelper.Initialize
ToolbarHelper.ShowUpIndicator = True
ACToolBarLight1.NavigationIconDrawable = MenuIcon
ACToolBarLight1.InitMenuListener
ACToolBarLight1.Title = "BlackOps MacroFlex"
ACToolBarLight1.SubTitle = ""
ACToolBarLight1.Color = Colors.DarkGray
SMenu.Initialize("SMenu")
Dim offset As Int = 100dip
SMenu.BehindOffset = offset
SMenu.Mode = SMenu.LEFT
Dim lftMenu As Panel
lftMenu.Initialize("")
SMenu.Menu.AddView(lftMenu, 0, 0, 100%x - offset, 100%y)
lftMenu.LoadLayout("left_menu")
Return lftMenu
End Sub