Public Sub InternalAddStubToCLVIfNeeded(CustomListView1 As CustomListView, Color As Int)
If CustomListView1.Size = 0 Then Return
Dim LastItem As CLVItem = CustomListView1.GetRawListItem(CustomListView1.Size - 1)
If LastItem.Offset + LastItem.Panel.Height < CustomListView1.AsView.Height Then
'add a stub item
Dim p As B4XView = xui.CreatePanel("stub")
p.Color = Color
Dim Height As Int = CustomListView1.AsView.Height - LastItem.Offset - LastItem.Panel.Height - 3dip
If xui.IsB4J Then Height = Height + 5
p.SetLayoutAnimated(0, 0, 0, CustomListView1.AsView.Width, Height)
CustomListView1.Add(p, "")
CustomListView1.sv.ScrollViewContentHeight = CustomListView1.sv.ScrollViewContentHeight - CustomListView1.DividerSize
End If
End Sub