Android Question Get a position x y cursor on a click inside scrollview ?

scsjc

Well-Known Member
Licensed User
Longtime User
hello,
is possible get a position from cursor on a Click ???

i'm use this code... OnTouch work ... but i need OnClick

B4X:
Dim r As Reflector
    r.Target = sv
    r.SetOnTouchListener("scvTest_Touch")

.
.
.


Sub scvTest_Touch(viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean
    Log(x)
    Log(Y)
End Sub
 

scsjc

Well-Known Member
Licensed User
Longtime User
Not directly. If you return False from this sub then the click event should be raised. You can store the coordiantes and check them in the Click event.

Hello, the problem is: if I click >>> not run a sub scvTest_Touch,
only run when I move and touch screen

And I need to run and get x and y when only a click touch screen

Thanks !!!
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
You can use the standard Touch event.
Store the touch coordinates when action is DOWN and compare them to the coordinates when action is UP. If they are close enough then treat it as a click event.

Thanks... im try
 
Upvote 0
Top