1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Detect release event on panel

Discussion in 'Android Questions' started by Marco Maria Vilucchi, Jun 10, 2019.

  1. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Hi all,
    I need to manage a button that, for example, shows an image while it's pressed and hides it when it's released.
    I thought of using a panel and the touch event, but I don't know how to intercept the moment when the finger is removed.
    Can someone help me?
    Thanks
    Marcom
     
  2. sorex

    sorex Expert Licensed User

    you can check the values or their 'representatives'

    Code:
    Sub mypanel_Touch (Action As Int, X As Float, Y As Float)
        
    Select Action
            
    Case mypanel.ACTION_DOWN

            
    Case mypanel.ACTION_UP     
    End Select
    End Sub
     
    Erel likes this.
  3. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    it means that when I touch panel I have case Action_Down and when release I have Action_UP?
    So simple?
     
  4. sorex

    sorex Expert Licensed User

    yep, everything is simple when you know how it works ;)
     
  5. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

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