Sub JSListView1_OnGetView(position As Int, itemLayout As ItemViewLayout, forViewUpdate As Boolean)
Log($"JSListView1_OnGetView @ Position: ${position}"$)
Dim iv As ItemViewLayout = itemLayout
Dim mapper As Map = JSListView1.DataSource.Get(position)
Dim p As Panel
p.Initialize("")
If forViewUpdate = False Then
p.LoadLayout("customlistview")
iv.Container = p
clvLabel.Tag = 1
clvInfo.Tag = 2
clvSub.Tag = 3
clvType.Tag = 4
clvImage.Tag = 5
'clvApply.Tag = 5
'clvComment.Tag = 6
'clvLike.Tag = 7
Private su As StringUtils
clvLabel.Height=su.MeasureMultilineTextHeight(clvLabel,mapper.Get("id") & mapper.Get("name"))
clvInfo.Top=clvLabel.Top+clvLabel.Height+5dip
clvInfo.Height=su.MeasureMultilineTextHeight(clvInfo,mapper.Get("info"))
clvSub.Top=clvInfo.Top+clvInfo.Height+5dip
clvSub.Height=su.MeasureMultilineTextHeight(clvSub,mapper.Get("type"))
iv.Height=su.MeasureMultilineTextHeight(clvLabel,clvLabel.Text)+su.MeasureMultilineTextHeight(clvInfo,clvInfo.Text)+su.MeasureMultilineTextHeight(clvSub,clvSub.Text)
iv.Width = 100%x
End If
clvLabel = iv.findViewWithTag(1)
clvInfo = iv.findViewWithTag(2)
clvSub = iv.findViewWithTag(3)
clvType = iv.findViewWithTag(4)
clvImage = iv.findViewWithTag(5)
'clvApply = iv.findViewWithTag(5)
'clvComment = iv.findViewWithTag(6)
'clvLike = iv.findViewWithTag(7)
clvLabel.Text = mapper.Get("id") & mapper.Get("name")
If m.Get("info")<>"" Then
clvInfo.Text = mapper.Get("info")
End If
clvType.Text = mapper.Get("type")
clvSub.Text = mapper.Get("wod")
p = iv.Container
If position Mod 2 = 0 Then
p.Color = Colors.Transparent
Else
p.Color = Colors.ARGB(20, 100, 100, 100)
End If
End Sub