Android Question Touch-event for CustomView

SamuelP

Member
Licensed User
Hello,

I use a custom view (the CustomListView-libary) and it seems, that I have no access to change the size and also not to handle the Touch-event.

As a workaround for change the size at runtime, I put the CustomView in a panel - that works. But how to handle the touch-event?

Thanks,
Samuel
 

SamuelP

Member
Licensed User
Okay, I noticed I have to implement it on my own in the original source.

B4X:
Public Sub Initialize (vCallback As Object, vEventName As String)
[...]
  
    Dim R As Reflector
    R.Target=sv
    R.SetOnTouchListener("sv_Touch")
  
End Sub

Sub sv_Touch(ViewTag As Object, Action As Int, X As Float,Y As Float, Motionevent As Object) As Boolean
    If SubExists(CallBack, EventName & "_Touch") Then
        CallSub(CallBack, EventName & "_Touch")
    End If
    Return False
End Sub
 
Upvote 0
Top