Android Question xCustomListView and TouchEvents

FrankBerra

Active Member
Licensed User
Longtime User
Hi there!

I am using xCustomListView (https://www.b4x.com/android/forum/t...listview-cross-platform-customlistview.84501/) for building an app with the idea to be ported to iOS in a future.

In a xCustomListView i load some panels that if they are touched they change their color.
The problem appears when i touch a panel and at the same time i scroll the xCustomListView: in this case the touched panel doesn't revert back to it's original (unpressed) colour.

For avoiding this i modified the xCustomListView class by adding:

B4X:
Dim S As Reflector
S.Target = sv 
S.SetOnTouchListener("sv_Touch")

and also:
B4X:
Private Sub sv_Touch (o As Object, ACTION As Int, x As Float, y As Float, motion As Object) As Boolean

    If ACTION = 1 Then 'ACTION_UP - https://developer.android.com/reference/android/view/MotionEvent.html#ACTION_UP
        If xui.SubExists(CallBack, EventName & "_TouchUP", 0) Then
            CallSubDelayed(CallBack, EventName & "_TouchUP")
        End If
           
    End If
   
    Return False
End Sub

On android works perfectly but i suppose this is not going to work on iOS (I dont' have an iOS yet to test).

My question is: are there more efficient and more cross platform oriented solutions for handling this problem?
 
Top