Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
TimeFont1 = Typeface.LoadFromAssets("gotic.ttf")
p.Initialize("")
p.Color = Colors.Transparent
p.SendToBack
Dim texto(9) As String=Array As String ("en","es","us","al","pi","po","na","ne","pi","jo")
Dim descrip(10) As Label
descrip(ii-1).Initialize("")
descrip(ii-1).Typeface = TimeFont1
descrip(ii-1).Gravity = Bit.OR(Gravity.TOP, Gravity.LEFT)
descrip(ii-1).Text =texto(ii-1)
descrip(ii-1).TextSize = 12
descrip(ii-1).TextColor = Colors.Black
p.AddView(descrip(ii-1), 55%x,1%y, 37%x,20%y) 'view #0
i=i+1
Dim fotoprod As ImageView
fotoprod.Initialize("fotoprod")
fotoprod.SetBackgroundImage(LoadBitmap(File.DirAssets,(i&".jpg")))
fotoprod.Gravity=Gravity.FILL
p.AddView(fotoprod, 2%x,1%y, 50%x,35%y) 'view #1
Dim flecha As ImageView
flecha.Initialize("flecha")
flecha.SetBackgroundImage(LoadBitmap(File.DirAssets,("flecharoja.png")))
flecha.Gravity=Gravity.FILL
p.AddView(flecha, 53%x,20%y, 12%x,7%y) 'view #2
Dim desc As Label
desc.Initialize("")
desc.Typeface = TimeFont1
desc.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
desc.Text = (20+i) & "%"
desc.TextSize = 12
desc.TextColor = Colors.White
p.AddView(desc, 55%x,20%y, 12%x,7%y) 'view #3
Dim precio As Label
precio.Initialize("")
precio.Typeface = TimeFont1
precio.Gravity = Gravity.LEFT
precio.Text = (20+i*i*9) & "€"
precio.TextSize = 12
precio.TextColor = Colors.Black
p.AddView(precio, 67%x,21.5%y, 15%x,7%y) 'view #4
Dim borde3 As ImageView
borde3.Initialize("borde3")
borde3.SetBackgroundImage(LoadBitmap(File.DirAssets,("borde3.png")))
borde3.Gravity=Gravity.FILL
p.AddView(borde3, 65.5%x,23.2%y, 10%x,0.2%y) 'view #5
Dim preciodescuento As Label
preciodescuento.Initialize("")
preciodescuento.Typeface = TimeFont1
preciodescuento.Gravity = Gravity.LEFT
preciodescuento.Text = ((20+i*i*9)/2) & "€"
preciodescuento.TextSize = 18
preciodescuento.TextColor = Colors.Red
p.AddView(preciodescuento, 77%x,20.5%y, 215%x,7%y) 'view #6
TimeFont = Typeface.LoadFromAssets("digi.ttf")
reloj(ii-1).Initialize("")
reloj(ii-1).Typeface = TimeFont
reloj(ii-1).Gravity = Gravity.LEFT
hora=DateTime.GetHour(DateTime.Now)
minuto=DateTime.GetMinute(DateTime.Now)
segundo=DateTime.GetSecond(DateTime.Now)
reloj(ii-1).TextSize = 17
reloj(ii-1).TextColor = Colors.Red
reloj(ii-1).Text = hora&":"&minuto&":"&segundo
p.AddView(reloj(ii-1), 53%x,30%y, 20%x,6%y) 'view #7
If ii=10 Then
tiempo3.Enabled=True
End If
Dim borde As ImageView
borde.Initialize("borde")
borde.SetBackgroundImage(LoadBitmap(File.DirAssets,("borde.png")))
borde.Gravity=Gravity.FILL
p.AddView(borde, 1%x,37%y,94%x,0.2%y) 'view #8
Dim borde2 As ImageView
borde2.Initialize("borde2")
borde2.SetBackgroundImage(LoadBitmap(File.DirAssets,("borde2.png")))
borde2.Gravity=Gravity.FILL
p.AddView(borde2, 0%x,43%y,100%x,4%y) 'view #9
b(ii-1).Initialize("b"&(ii-1)) 'all buttons click events will be handled with Sub Button_Click
b(ii-1).Color=Colors.Red
b(ii-1).TextColor=Colors.White
b(ii-1).Typeface = TimeFont1
b(ii-1).Text="VER"
b(ii-1).Gravity=Gravity.CENTER_HORIZONTAL
b(ii-1).Enabled=True
b(ii-1).Visible=True
b(ii-1).Text =ii& " VER"
b(ii-1).TextSize=12
b(ii-1).Tag=(ii-1)
p.AddView(b(ii-1), 75%x,28%y, 20%x,7%y) 'view #10
Dim txtprod As Label
txtprod.Initialize("")
txtprod.Typeface = TimeFont1
txtprod.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
txtprod.Text = Text
txtprod.TextSize = 16
txtprod.TextColor = Colors.Black
p.AddView(txtprod, 57%x,5%y, 25%x, 5%y) 'view #11
' Dim logo As ImageView
' Dim nombreemp As Label
' Dim sector As Label
Return p
End Sub
Sub b2_Click
Log("va bien")
End Sub
Sub b3_Click
Log("va asdasdasdasd")
End Sub
Sub b9_Click
Log("xxxxxxxxxxxxxxxxx")
End Sub