Android Question draggableview parent click button

Addo

Well-Known Member
Licensed User
Longtime User
i am trying to use draggableview class from this thread

https://www.b4x.com/android/forum/threads/dragging-views.70882/

all works fine, but there is one problem , i have placed a button inside the panel that should be dragged when i try to click on the button the click event does not fired any idea why ?

project sample attached
 

Attachments

  • dragableview click.zip
    8.3 KB · Views: 162

udg

Expert
Licensed User
Longtime User
Looking at the DV original code, you can see that a transparent panel is the one getting the "touch" . This panel, in turns, drags the underlying view (in your case your panel). You could try to transfer the draggable functionality to your panel, read a "click", verify it's on the button and the act properly.
ps: I'm away from my PC so I can't read your code right now. Surely there will be easier ways to accomplish what you need
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
Looking at the DV original code, you can see that a transparent panel is the one getting the "touch" . This panel, in turns, drags the underlying view (in your case your panel). You could try to transfer the draggable functionality to your panel, read a "click", verify it's on the button and the act properly.
ps: I'm away from my PC so I can't read your code right now. Surely there will be easier ways to accomplish what you need

i have tried to find a tweak for it but totally failed
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Corrected the code.
It is never good to create a panel that overpowers the views because it absorbs the events.

Now work fine
 

Attachments

  • Draggable1.zip
    8.2 KB · Views: 243
Upvote 0
Top