Android Question GestureDetector v.2.2 - anything like an onDragUp Event?

Discussion in 'Android Questions' started by Horrorfrosch, Apr 12, 2015.

  1. Horrorfrosch

    Horrorfrosch New Member Licensed User

    It's my first post and want to say Hi to everyone and how much I appreciate this forum :)

    Hi,

    I use B4A for a week now, so I'm a newbie.

    I use GestureDetector to drag views around, but I couldn't find an "onDragUp" event anywhere. I want to fire an event as soon as the dragging ends.

    I tried Activity_Touch, but that doesn't seem to work in combination with the dragging (of course).

    I guess it's really routine but I just don't figure out how to do it. I would be really thankful for any advice how to get this done.

    Best regards
     
  2. Beja

    Beja Expert Licensed User

    PseudoCode:

    dim Fx as float
    dim Fy as float

    timer1.interval = 1000
    Timer1.enabled = true

    Timer1_tick
    If View1 Fx AND Fy didn't change for 1000 milliseconds then
    it's dropped and you can do whatever you want.
    End if

    a poorman's solution but will work.. you will lose 1 second though..
     
  3. Horrorfrosch

    Horrorfrosch New Member Licensed User

    Hi Beja,

    thank you for your quick answer. Yes, I already thought of polling, but actually I wanted to avoid it.
    But maybe there is no other way, at least with this library. :)
     
  4. Informatix

    Informatix Expert Licensed User

    You should look at the log in the Drag example. You would see that a Touch event is raised when you lift the finger.
     
    lemonisdead likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice