'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim p1, p2 As Panel
Dim ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Glossaire")
AfficheGlossaire
End Sub
Sub AfficheGlossaire
...
p1.Initialize("p1")
Activity.AddView (p1, 0, 0, Activity.Width, Activity.Height)
...
ListView1.Initialize("ListView1")
p1.AddView(ListView1, 5%x, 95dip, 90%x, 80%y)
...
' To create a listview with rounded corners create a shape in xml
' Create roundedcorner.xml in the res/drawable
SetDrawable(ListView1, "roundedcorner")
End Sub
Sub SetDrawable(Control As ListView, XMLName As String)
'*** In java set your listview : ListView.(R.drawable.roundedcorner);
Dim r As Reflector
Dim package As String
Dim id As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
id = r.GetStaticField(package & ".R$drawable", XMLName)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Control.Background = r.RunMethod2("getDrawable", id, "java.lang.int")
End Sub