I am trying center an EditText view in a panel that should mean there is a 5 pixel red border around the edittext. I am obviously missing something fundamental (noob with android) as I would expect the code below to work. What am I doing wrong? Is the border of the EditText not included in it's height and width?
B4X:
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 EditBoxPanel As Panel
Dim ET1 As EditText
Dim CDB As ColorDrawable
Dim EditBoxPanel2 As Panel
Dim ET2 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
CDB.Initialize(Colors.ARGB(255,255,0,0),0)
EditBoxPanel.Initialize("")
ET1.Initialize("")
EditBoxPanel.Initialize("")
ET2.Initialize("")
EditBoxPanel2.Initialize("")
ET1.TextSize = 10
ET2.TextSize = 10
Activity.Height = 100%y
Activity.Width = 100%x
Activity.AddView(EditBoxPanel,5,100,100,40)
EditBoxPanel.AddView(ET1,5,5,90,30)
EditBoxPanel.Background = CDB
EditBoxPanel2.Background = CDB
Activity.AddView(EditBoxPanel2,5dip,5dip,100dip,40dip)
EditBoxPanel2.AddView(ET2,5dip,5dip,90dip,30dip)
End Sub