Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("Panel") '<---I add the eventname Panel here
p.SetLayout(0, 0, Width, Height)
p.LoadLayout("CellItem")
Label1.Text = Text
Return p
End Sub
Sub clv_ItemLongClick (Index As Int, Value As Object)
log("You pressed the Long click")
End Sub
Private Sub PanelLongClickHandler(SenderPanel As B4XView)
Dim clr As Int = clv.GetRawListItem(SenderPanel.Tag).Panel.Color
Dim PressedColor As Int = 0xFF7EB4FA
Dim EventName As String = "clv"
SenderPanel.SetColorAnimated(50, clr, PressedColor)
If xui.SubExists(Me, EventName & "_ItemLongClick", 2) Then
CallSub3(Me, EventName & "_ItemLongClick", SenderPanel.Tag, clv.GetRawListItem(SenderPanel.Tag).Value)
End If
Sleep(200)
SenderPanel.SetColorAnimated(200, PressedColor, clr)
End Sub
#If B4A
Private Sub Panel_LongClick
PanelLongClickHandler(clv.GetRawListItem(clv.GetItemFromView(Sender)).Panel)
End Sub
#Else If B4i
Private Sub Panel_LongClick
PanelLongClickHandler(Sender)
End Sub
#Else If B4J
' Private Sub Panel_MouseLongClicked (EventData As MouseEvent)
' PanelLongClickHandler(Sender)
' End Sub
#End If