Sub clv1_ItemClick (Index As Int, Value As Object)
Dim item As CLVItem = clv1.GetItem(Index)
Dim p As B4XView = clv1.GetPanel(Index)
p.RemoveViewFromParent
p.Color = item.Color
If Bit.And(0xff000000, item.Color) = 0 Then
p.Color = xui.Color_Gray
End If
clv1.RemoveAt(Index)
clv1.sv.ScrollViewInnerPanel.AddView(p, 0, item.Offset, clv1.sv.Width, p.Height)
Dim Duration As Int = 1000
p.SetLayoutAnimated(Duration, 0, clv1.GetItem(clv1.LastVisibleIndex).Offset + 100dip, p.Width, p.Height)
Sleep(Duration)
p.RemoveViewFromParent
p.Color = item.Color
clv1.Add(p, item.Value)
Sleep(0)
clv1.ScrollToItem(clv1.Size - 1)
End Sub