Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private iv As ImageView
Private p As Panel
Private pState As Int = 0 'panel visible or not
Private bt As Button
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")
iv.Initialize("iv")
Activity.AddView(iv,0,0,100%x,100%y)
Dim b As Bitmap
b.Initialize(File.DirAssets,"1.png")
iv.Bitmap=b
p.Initialize("panel")
Activity.AddView(p,-100dip, 0, 100dip,100dip)
Dim cd As ColorDrawable
cd.Initialize(Colors.ARGB(100, 255,0,0), 0)
p.Background = cd
bt.Initialize("Button")
p.AddView(bt, 20dip,20dip, 60dip,60dip)
End Sub
Sub iv_Click
If pState = 0 Then
p.SetLayoutAnimated(100, 0,0 , 100dip,100dip)
pState = 1
Else
p.SetLayoutAnimated(100, -100dip,0 , 100dip,100dip)
pState = 0
End If
End Sub
Sub button_click
Log("Button click")
End Sub