B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=11
@EndOfDesignText@
Sub Class_Globals
	Dim AActivity As Activity
	Dim pnl,mnupnl,pnlfooter As Panel
	Dim appimage, menuimage, backimage As ImageView
	
	Dim Title, footer As Label
	Dim Titletext As String
	Dim menulist As List
	
	Public lvMenu As ListView
	Dim BarSize As Int=5%y
	
	
End Sub

'Initializes the object. You can add parameters to this method if needed.
public Sub setpanel
	pnl.Top=0
	pnl.Left=0
	pnl.Width=100%x
	pnl.Height=BarSize+2
	
End Sub
Public Sub Initialize
	
	appimage.Initialize("")
	menuimage.Initialize("menu")
	backimage.Initialize("back")
	menuimage.Visible=False
	backimage.Visible=False
	pnl.Initialize("")
	pnl.Top=0
	pnl.Left=0
	pnl.Width=100%x
	pnl.Height=BarSize+2
	pnl.Color=Colors.DarkGray
	appimage.Bitmap=LoadBitmapResize(File.DirAssets,"icon.png",BarSize,BarSize,True)
	
	
	Title.Initialize("")
	Title.Text=Titletext
	Title.TextColor=Colors.White
	Title.TextSize=20

	menuimage.Bitmap=LoadBitmapResize(File.DirAssets,"menuicon.png",BarSize,BarSize,True)
	backimage.Bitmap=LoadBitmapResize(File.DirAssets,"arrowback.png",BarSize,BarSize,True)
	Dim pc As ColorDrawable
	pc.Initialize2(0xFF077AFF,1,1,0xFF077AFF)
	pnl.Background=pc
	pnl.AddView(appimage,0,0,BarSize,BarSize)
	pnl.AddView(menuimage,100%x-BarSize,1,BarSize,BarSize)
	pnl.AddView(backimage,100%x-BarSize,1,BarSize,BarSize)

	pnl.AddView(Title,appimage.Width+2%X,appimage.Top+2,60%X,BarSize)
	
	pnlfooter.Initialize("")
	footer.Initialize("")

	pnlfooter.Height=BarSize/3
	pnlfooter.Background=pc
	footer.Text=Chr(0x00A9)& "2021 - Stefan Hutter Unternehmensberatung"
	footer.Gravity=Gravity.CENTER
	footer.Width=100%x
	pnlfooter.AddView(footer,1,1,pnlfooter.Width,pnlfooter.Height)
	
	
End Sub

public Sub Initialize2
	AActivity.AddView(pnl,0,0,pnl.Width,BarSize)
	AActivity.AddView(pnlfooter,0,100%y-pnlfooter.Height,100%x,pnlfooter.Height)
End Sub

Public Sub AddMenu
	lvMenu.Initialize("lvmenu")
	lvMenu.AddSingleLine("Einstellungen")
	lvMenu.AddSingleLine("Über...")
	lvMenu.SingleLineLayout.Label.Textcolor=Colors.Black
	menulist.Initialize()

	mnupnl.Initialize("")
	mnupnl.Width=60%x
	mnupnl.Height=lvMenu.Size*BarSize*2
	mnupnl.Color=Colors.LightGray
	mnupnl.Top=BarSize+1
	mnupnl.Left=100%x-mnupnl.Width
	mnupnl.AddView(lvMenu,1,1,mnupnl.Width,mnupnl.Height)$
	Dim c As ColorDrawable
	c.Initialize2(Colors.White,5dip,3dip,Colors.DarkGray)
	mnupnl.Background = c
	mnupnl.Visible=False
	AActivity.AddView(mnupnl,100%x-mnupnl.Width,BarSize+1,mnupnl.Width,mnupnl.Height)
backimage.Visible=False
menuimage.Visible=True
End Sub

Sub menu_click
	If mnupnl.Visible=False Then mnupnl.Visible=True Else mnupnl.Visible=False
End Sub


Private Sub lvmenu_ItemClick (Position As Int, Value As Object)
	If Value="Einstellungen" Then StartActivity("Parameter")
	If Value="Über..." Then StartActivity("About")
	
	mnupnl.Visible=False
End Sub

Public Sub SetTitle
	Title.Text=Titletext
End Sub

Public Sub HideMenu
	menuimage.Visible=False
	backimage.Visible=True
End Sub

Public Sub Back_Click
	AActivity.Finish
End Sub


