Android Question Disable Scrollview click event

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi to all!
I have a simple scrollview with some elements inside it. Scrollview is placed in a panel. I'm not able to handle the panel event, so i suppose that scrollview's inner panel handle an event on click and prevent the click on parent panel. Is possible to disable this event, in order to achieve the Parent event?

I tried to initialize scrollview with this, but doesn't work

B4X:
scv.initialize(0)
scv.initialize2(0,"")

Thanks!
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
ScrollView does handle the touch gestures. It will not pass them to the underlying control.

Maybe you can add a gesture detector.
I tried also this, but I could not do it. I tried to use Reflection to handle click event on Scrollview. Tried this, but doesn't work

B4X:
Dim r As Reflector
    r.Target = scv.Panel
    r.SetOnClickListener("scvPanel_Click")
    r.Target = scv
    r.SetOnClickListener("scvPanel_Click")
 
Upvote 0

Emme Developer

Well-Known Member
Licensed User
Longtime User
This is a problematic UX. How do you want to distinguish between a scroll gesture and a click gesture?
Maybe the problem is that i don't need to handle the scroll gesture, but i understand that system needs it.
I have a scroll view with some element, every element is a HorizzontalScrollview. You can swipe the Hscv to reveal an hide contextual menu (like gmail). Designer asks me to handle the click on page, in order to close the Hscv if is menu is visible. I think i can add a panel inside the scrollview, to handle the event, but this means that i need to rewrite all pages as i use Z-order to achieve some things
 
Upvote 0
Top