Android Question [B4X] [XUI] xCustomListView - How Add new events and properties?

Myr0n

Active Member
Licensed User
Hello,

Is really nice that the [B4X] [XUI] xCustomListView is included as an internal library but in my case I found some Cons, like some of my apps use an event
B4X:
#Event: ItemLongClick (Index As Int, Value As Object)
and to handle this event I use
B4X:
#If B4A
Private Sub Panel_LongClick
    PanelLongClickHandler(Sender)
End Sub
#Else If B4i
    Private Sub Panel_LongClick
        PanelLongClickHandler(Sender)
    End Sub
#Else If B4J
    Private Sub Panel_MouseClicked (EventData As MouseEvent)
        PanelLongClickHandler(Sender)
    End Sub
#End If

Private Sub PanelLongClickHandler(SenderPanel As B4XView)
    Dim clr As Int = GetItem(SenderPanel.Tag).Color
    SenderPanel.SetColorAnimated(50, clr, PressedColor)
    If xui.SubExists(CallBack, EventName & "_ItemLongClick", 2) Then
        Sleep(100)
        SenderPanel.SetColorAnimated(200, PressedColor, clr)
        CallSub3(CallBack, EventName & "_ItemLongClick", SenderPanel.Tag, GetItem(SenderPanel.Tag).Value)
    End If
    Sleep(100)
    SenderPanel.SetColorAnimated(200, PressedColor, clr)
End Sub

Another thing that happened is that the PanelClickHandler has a bug that for some is minimum but for others like me it is a Cons.

The original PanelClickHandler is:

B4X:
'Original Click Handler - [XUI] xCustomListView
Private Sub PanelClickHandler(SenderPanel As B4XView)
    Dim clr As Int = GetItem(SenderPanel.Tag).Color
    SenderPanel.SetColorAnimated(50, clr, PressedColor)
    If xui.SubExists(CallBack, EventName & "_ItemClick", 2) Then
        CallSub3(CallBack, EventName & "_ItemClick", SenderPanel.Tag, GetItem(SenderPanel.Tag).Value)
    End If
    Sleep(200)
    SenderPanel.SetColorAnimated(200, PressedColor, clr)
End Sub

I tweak with :
B4X:
Private Sub PanelClickHandler(SenderPanel As B4XView)
    Dim clr As Int = GetItem(SenderPanel.Tag).Color
    SenderPanel.SetColorAnimated(50, clr, PressedColor)
    If xui.SubExists(CallBack, EventName & "_ItemClick", 2) Then
        Sleep(100)
        SenderPanel.SetColorAnimated(200, PressedColor, clr)
        CallSub3(CallBack, EventName & "_ItemClick", SenderPanel.Tag, GetItem(SenderPanel.Tag).Value)
    End If
    Sleep(100)
    SenderPanel.SetColorAnimated(200, PressedColor, clr)
End Sub

And now the final question, is it possible to add the now internal library xCustomListView to our project and add a new module -> class module ->Custom view (XUI) and be part of the xCustomListView library? in this case but could be applied to other libraries like FireBase, etc..

I tried but does not work.

Or should I continue using the xCustomView as a module?

Well for the me moment I'm sure that I will, but if there is a nice solution, please let me know.
 

DonManfred

Expert
Licensed User
the now internal library xCustomListView
xCustomListview is not a internal library. It is a Classmodule. XUI is an Internal Library.

You can continue using the Class module.
 
Upvote 0

Myr0n

Active Member
Licensed User
xCustomListview is not a internal library. It is a Classmodule. XUI is an Internal Library.

You can continue using the Class module.

Thank you for your answer, according to this yes there is and according to the folder C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries there is a xCustomListView.jar and xCustomListView.xml.

Erel's said:
Firebase, xCustomListView and KeyValueStore (2) are internal libraries
 
Upvote 0

Myr0n

Active Member
Licensed User
Thank you so much again, as I said "Well for the me moment I'm sure that I will, but if there is a nice solution, please let me know"
 
Upvote 0

Myr0n

Active Member
Licensed User
Thank you
 
Upvote 0
Top