Private Sub CreateItem(Width As Int,I As Int) As Panel
Dim p As Panel = xui.CreatePanel("")
Dim height As Int = Activity.Height/2 + 2dip' 200dip '280dip
Dim a As Int = DipToCurrent(Activity.Height/2 + 2dip)
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 310dip
p.SetLayoutAnimated(0, 0, 0, Width, height)
p.LoadLayout("Pochette")
Dim k As Int = 0
For Each v As View In p.GetAllViewsRecursive
If v Is Button Then
Dim bmpTeam1 As BitmapDrawable
Dim bmpTeam2 As BitmapDrawable
Dim BitmapTemp1 As Bitmap
Dim BitmapTemp2 As Bitmap
BitmapTemp1.Initialize3(ResizeBitmap(bitmaps.Get(i+k),ImageView1.Width -20dip,ImageView1.Height-20dip,True))
BitmapTemp2.Initialize3(ResizeBitmap(bitmaps.Get(i+k),ImageView1.Width,ImageView1.Height,True))
bmpTeam1.Initialize(BitmapTemp1)
bmpTeam1.Gravity= Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
bmpTeam2.Initialize(BitmapTemp2)
bmpTeam2.Gravity= Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Focused, bmpTeam2)
sld.AddState(sld.State_Disabled, bmpTeam1)
v.Background = sld
k=k+1
End If
Next
Dim k As Int = 0
For Each v As View In p.GetAllViewsRecursive
If v.Tag = "Label" Then
Dim frc As ColorDrawable
If NoVue.Get(i+k) = 1 Then
frc.Initialize2(Colors.Transparent, 5dip, 1dip, Colors.Green)
Else
frc.Initialize2(Colors.Transparent, 5dip, 1dip, Colors.Red)
End If
v.Background = frc
k=k+1
End If
Next
Return p
End Sub