Sub myULV_lc(LayoutName As String, LayoutPanel As Panel)
Dim w As Float = LayoutPanel.Width/5
For i = 0 To 3
Dim lbl As Label
lbl.Initialize("")
lbl.color = Colors.Transparent
lbl.TextColor = Colors.RGB(52,73,94)
lbl.TextSize = 15*fontajust
lbl.Gravity = Gravity.CENTER
lbl.Typeface = Typeface.DEFAULT
LayoutPanel.AddView(lbl, i*w, 0, w, LayoutPanel.Height)
Next
Dim btn4 As Button 'view 4
btn4.Initialize("CldBtn")
LayoutPanel.AddView(btn4,(4.095*w),LayoutPanel.Height*0.075, w-(w*0.175), LayoutPanel.Height*0.835)
Dim lbl As Label 'view 5
lbl.Initialize("")
lbl.color = Colors.Transparent
lbl.TextColor = Colors.White
lbl.TextSize = 9*fontajust
lbl.Gravity = Gravity.CENTER
lbl.Typeface = Typeface.DEFAULT_BOLD
LayoutPanel.AddView(lbl, 4*w, 0, w, LayoutPanel.Height*0.525)
Dim lbl As Label 'view 6
lbl.Initialize("")
lbl.color = Colors.Transparent
lbl.TextColor = Colors.RGB(52,73,94)
lbl.TextSize = 15*fontajust
lbl.Gravity = Gravity.CENTER
lbl.Typeface = Typeface.DEFAULT
LayoutPanel.AddView(lbl, 4*w, LayoutPanel.Height*0.035, w, LayoutPanel.Height)
Dim btn As Button 'view 7
btn.Initialize("CldBtndown")
btn.Color = Colors.Transparent
LayoutPanel.AddView(btn, (4.375*w), LayoutPanel.Height-(LayoutPanel.Height*0.125), w*0.25, LayoutPanel.Height*0.05)
Dim checkPnl As Panel 'view 8
checkPnl.Initialize("")
checkPnl.Visible = False
LayoutPanel.AddView(checkPnl,(4.175*w),LayoutPanel.Height*0.145, w*0.65, w*0.65)
Dim desrect As Rect
desrect.Initialize(checkPnl.Width*0.1,checkPnl.Height*0.1,checkPnl.Width*0.9,checkPnl.Height*0.9)
Dim cnv As Canvas
cnv.Initialize(checkPnl)
cnv.DrawCircle(checkPnl.Width/2,checkPnl.Height/2,checkPnl.Width/2,colorArray(colorInt),True,0)
cnv.DrawBitmap(LoadBitmap(File.DirAssets,"sel1x.png"),Null,desrect)
checkPnl.Invalidate
Dim bmp As Bitmap
bmp.Initialize(File.DirAssets,"note4.png")
Dim noteimg As ImageView 'view 9
noteimg.Initialize("")
noteimg.Bitmap = bmp
noteimg.Gravity = Gravity.FILL
noteimg.Visible = False
LayoutPanel.AddView(noteimg,4.075*w,LayoutPanel.Height-(w*0.35), w*0.265, w*0.265)
Dim splbl As Label
splbl.Initialize("")
splbl.Visible = False
splbl.color = Colors.Transparent
splbl.TextColor = Colors.RGB(52,73,94)
splbl.TextSize = 15*fontajust
splbl.Gravity = Gravity.CENTER
splbl.Typeface = Typeface.DEFAULT
LayoutPanel.AddView(splbl,2*w, 0, 2*w, LayoutPanel.Height)
End Sub
Sub myULV_cf(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
LogColor("myulv_cf",Colors.Blue)
LayoutPanel.color = Colors.White
Dim listshift As shift
Select LayoutName.ToLowerCase
Case "myulv0"
listshift = shiftlist.Get(Position)
Case "myulv1"
listshift = visshiftlist1.Get(Position)
Case "myulv2"
listshift = visshiftlist3.Get(Position)
End Select
Dim lbl1 As Label = LayoutPanel.GetView(0)
lbl1.Text = listshift.totalwage
Dim lbl2 As Label = LayoutPanel.GetView(1)
If listshift.totalminutes = 0 Then lbl2.Text = "0:00" Else lbl2.Text = getworkedtime(listshift.totalminutes)
Dim lbl3 As Label = LayoutPanel.GetView(2)
If listshift.timeout = 0 Then lbl3.Text = "--:--" Else lbl3.Text = DateTime.Time(listshift.timeout)
Dim lbl4 As Label = LayoutPanel.GetView(3)
lbl4.Text = DateTime.Time(listshift.timein)
Dim btn As Button = LayoutPanel.GetView(4)
' btn.Tag = ItemID
Dim vd As VectorDrawable
vd.Initialize("zzz_calendar_blank")
vd.ColorFilter = colorArray(colorInt)
vd.Alpha = 255
btn.Background = vd.Current
Dim lbl5 As Label = LayoutPanel.GetView(5)
lbl5.Text = WeekDaysStr(DateTime.GetDayOfWeek(listshift.timein)-1)
lbl5.TextColor = Colors.White
' DateTime.DateFormat = "dd/MM/yyyy"
Dim lbl6 As Label = LayoutPanel.GetView(6)
lbl6.Text = DateTime.GetDayOfMonth(listshift.timein)
lbl6.TextColor = Colors.Black
Dim btn2 As Button = LayoutPanel.GetView(7)
btn2.Color = listshift.btnimg
If listshift.timeout = 0 Then
lbl1.TextColor = Colors.Red
lbl2.TextColor = Colors.Red
lbl3.TextColor = Colors.Red
lbl4.TextColor = Colors.Red
Else
lbl1.TextColor = Colors.Black
lbl2.TextColor = Colors.Black
lbl3.TextColor = Colors.Black
lbl4.TextColor = Colors.Black
End If
Dim checkpnl As Panel = LayoutPanel.GetView(8)
btn.Tag = checkpnl
Dim noteimg As ImageView = LayoutPanel.GetView(9)
If listshift.dayinfo <> "" And listshift.dayinfo <> "specialdays" Then
noteimg.Visible = True
Else
noteimg.Visible = False
End If
Dim splbl As Label = LayoutPanel.GetView(10)
If listshift.dayinfo = "specialdays" Then
splbl.Text = listshift.shiftid
splbl.Visible = True
lbl3.Visible = False
lbl4.Visible = False
Else
splbl.Visible = False
lbl3.Visible = True
lbl4.Visible = True
End If
LayoutPanel.Tag = listshift 'shift type to tag property
End Sub