Android Question Gesture Detector doesn't work with CustomListView

MrKim

Well-Known Member
Licensed User
Longtime User
CustomListView uses a scrollview and I can't get it to work?

Unless I am looking at the wrong customlistview?
https://www.b4x.com/android/forum/threads/customlistview-a-flexible-list-based-on-scrollview.19567/


Code:
Sub Class_Globals
....
....Dim GD AsGestureDetector, DiscardOtherGestures As Boolean, FilterMoveEvents As Boolean
End SubPublic Sub Initialize (vCallback As Object, vEventName AsString)
sv.Initialize2(0, "sv")
items.Initialize
panels.Initialize
dividerHeight = 2dip
EventName = vEventName
CallBack = vCallback
sv.Color = 0xFFD9D7DE'this sets the dividers colorDim r AsReflectorDim idPressed As Int
idPressed = r.GetStaticField("android.R$drawable", "list_selector_background")
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
pressedDrawable = r.RunMethod2("getDrawable", idPressed, "java.lang.int")
DefaultTextColor = Colors.White
DefaultTextSize = 16
DefaultTextBackgroundColor = Colors.Black
DefaultTextBackground = Null

GD.SetOnGestureListener(sv, "Gesture")End Sub
....
......
 

MrKim

Well-Known Member
Licensed User
Longtime User
What is not working? What are you trying to do?
Figured it out. On a listview SetOnGestureListener will work binding it to the Listview, with scroll view you have to bind it to the individual panels that you add.
 
Upvote 0

cxdzbl

Active Member
Licensed User
Even if you bind sv.Panel, you can only get the move and up events, and down the event to still get it.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…