private Sub DesignerList
Dim HeightListView As Int = 0
Dim Space As Int
If ListItem.size>0 Then
If AppPanel.IsInitialized Then AppPanel.RemoveView
MyAct.addview(AppPanel,0,0,100%x,100%Y)
If RoundCorner Then ListPanel.Color=Colors.Transparent Else ListPanel.Color=BColorList
ListPanel.RemoveView
ListPanel.Panel.RemoveAllViews
ListPanel.Panel.Height=0
For i=0 To ListItem.Size-1
Dim Item As Item
Item.Initialize
Item = ListItem.Get(i)
Dim P As Panel
P.Initialize("PanelClick")
If RoundCorner Then P.Background=Corner(Item.BackgroundColor) Else P.Color=Item.BackgroundColor
P.Tag=I
Try
Space=40dip
Dim Ima As ImageView
Ima.Initialize("")
Ima.Gravity=Gravity.FILL
If RoundCorner Then
Ima.SetBackgroundImage(RoundBorders(Item.Image,20dip))
Else
Ima.SetBackgroundImage(Item.Image)
End If
P.AddView(Ima,0dip,5dip,40dip,40dip)
Catch
Space=0dip
End Try
Dim La As Label
La.Initialize("")
La.Text=Item.text
La.TextSize=15
La.Color=Colors.Transparent
La.TextColor=Item.TextColor
La.Typeface=Typeface.DEFAULT_BOLD
La.Gravity=Item.G
P.AddView(La,Space,0dip,mBase.Width-Space,30dip)
If Item.texthelp.Trim<>"" Then
Dim La As Label
La.Initialize("")
La.Text=Item.TextHelp
La.TextSize=12
La.Color=Colors.Transparent
La.TextColor=Item.TextColor
La.Gravity=Item.G
P.AddView(La,Space,25dip,mBase.Width-Space,30dip)
Else
La.Height=50dip
End If
ListPanel.Panel.AddView(P,-mBase.Width,HeightListView,mBase.Width-2DIP,49dip)
P.SetLayoutAnimated(10+(HeightListView/3),1dip,HeightListView,mBase.Width-2DIP,49dip)
HeightListView=HeightListView+50dip
Next
ListPanel.Panel.Height=HeightListView
Dim LeftSpinner,TopSpinner,HeightSpinner,Yafter As Int
If GrayDisplay Then AppPanel.Color=Colors.aRGB(200,0,0,0) Else AppPanel.Color=Colors.Transparent
If ScrollViewParent.IsInitialized Then
If Left+mBase.Width+ScrollViewParent.Left>100%x Then LeftSpinner=100%x-mBase.Width Else LeftSpinner=Left
Else
If Left+mBase.Width>100%x Then LeftSpinner=100%x-mBase.Width Else LeftSpinner=Left
End If
Yafter=100%y-Top-mBase.Height
If ScrollViewParent.IsInitialized Then
baseTop=Top
Yafter=Yafter+ScrollViewParent.ScrollPosition
Top=Top-ScrollViewParent.ScrollPosition
End If
If (HeightListView>Top)And (HeightListView>Yafter) Then
' Non va bene dappertutto
If (Top>100%y-Top-mBase.Height) Then
'sopra é più grande
TopSpinner=0dip
HeightSpinner=Top
Else
'sotto è più grande
TopSpinner=Top+mBase.Height
HeightSpinner=100%y-Top-mBase.Height
End If
Else if (HeightListView>Top) And (HeightListView<=Yafter) Then
' Va bene di sotto
TopSpinner=Top+mBase.Height
HeightSpinner=HeightListView
Else If (HeightListView<=Top)And (HeightListView>Yafter) Then
' Va bene di sopra
TopSpinner=Top+mBase.Height-HeightListView
HeightSpinner=HeightListView
Else
' Haqspazio sopra e sotto
TopSpinner=Top+mBase.Height
HeightSpinner=HeightListView
End If
If ScrollViewParent.IsInitialized=False Then
AppPanel.AddView(ListPanel,LeftSpinner,TopSpinner,mBase.Width,HeightSpinner)
Else
AppPanel.AddView(ListPanel,LeftSpinner,TopSpinner,mBase.Width,HeightSpinner)
End If
Top=baseTop
'AppPanel.Visible=True
End If
End Sub