#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim p As Panel
Dim b1 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")
b1.Initialize ("b1") 'intialize button
b1.Text = "Click Me"
p.Initialize ("p") 'intialize panel
p.Color = Colors.White
Activity.AddView(p,10dip,10dip,200dip,100dip) 'add panel to actvity
Activity.AddView(b1,10dip,Activity.Height - 100dip,100dip,100dip) 'add button to actvity
End Sub
Sub b1_click
doanimation(p,200dip,200dip,100dip,100dip) 'start resize
End Sub
Sub Activity_Resume
End Sub
Sub doanimation(selp As Panel,maxw As Int, maxh As Int,minw As Int, minh As Int)
If selp.Height >= maxh Then
Do Until selp.Height <= minh
selp.Height = selp.Height - 5dip
DoEvents
Loop
Else
Do Until selp.Height >= maxh
selp.Height = selp.Height + 5dip
DoEvents
Loop
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub