Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private PanelMain As B4XView
Dim xui As XUI
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim x As Int
'Output should be ever larger growing circles of different colors
For x = 0 To 8
Log(x)
Sleep(1000)
Draw(x)
Next
PanelMain.RemoveAllViews
'Output should just be one large red circle
For x = 8 To 0 Step -1
Log(x)
Sleep(1000)
Draw(x)
Next
End Sub
Private Sub Draw(pick As Int)
Dim index As Int = pick Mod 9
Dim listColors(9) As Int = Array As Int (xui.Color_Black,xui.Color_Blue,xui.Color_Cyan,xui.Color_DarkGray,xui.Color_Gray,xui.Color_Green,xui.Color_LightGray,xui.Color_Magenta,xui.Color_Red)
'PanelMain.RemoveAllViews ' Without this the Canvas does not draw anything, it draws only the first time.
Dim aCanvas As B4XCanvas
aCanvas.Initialize(PanelMain)
aCanvas.DrawCircle(PanelMain.Width/2, PanelMain.Height/2,(50+25*index)*1dip,listColors(index),True,1dip)
aCanvas.Invalidate
End Sub