Android Question GestureDetector And Scrollview

Status
Not open for further replies.

alon

Active Member
Licensed User
Longtime User
Hi,
I have an app that need to have the ability to let the customer to sign on it.
so i am using the GestureDetector lib.
I create the GestureDetector on a label wich the customer need to sign on it.
the problem is that the label is on a scrollview so when i am trying to sign on the label,
the scrollview is moving and I cannot sign on the label.

Is there a way to disable the scrolling while signing

Thanks...
 

alon

Active Member
Licensed User
Longtime User

Attachments

  • DisableScrolView.zip
    389.3 KB · Views: 359
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I would have used Reflector.SetOnTouchListener for this.

However the important point is to disable the ScrollView when the touch starts with:
B4X:
Dim jo As JavaObject = svJobInfo
jo.RunMethod("requestDisallowInterceptTouchEvent", Array(False))
And reenable it when the touch ends in (UP action):
B4X:
Dim jo As JavaObject = svJobInfo
jo.RunMethod("requestDisallowInterceptTouchEvent", Array(True))
 
Upvote 0

alon

Active Member
Licensed User
Longtime User
Sorry but still not working for me.
I tries to put it in the Gesture_onPointerDown and Gesture_onPointerUp
I also tried to use Reflector and it is not working.

What am i missing here?
 

Attachments

  • DisableScrolView.zip
    39.2 KB · Views: 326
Upvote 0

cxbs

Active Member
Licensed User
Longtime User
Hi ,
Is there a way to know if the signpad is clear/empty.

Thanks

Try this!

B4X:
Sub Gesture_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
    If Action=GD.ACTION_DOWN Then
        Dim jo As JavaObject = SV
        jo.RunMethod("requestDisallowInterceptTouchEvent", Array(True))       
    Else If Action = GD.ACTION_UP Then
        Dim jo As JavaObject = SV
        jo.RunMethod("requestDisallowInterceptTouchEvent", Array(False))
        'Removes the first painter from the list
        Gesture_onPointerUp(0, 0, MotionEvent)
    End If
    Return True
End Sub
 
Upvote 0

cxbs

Active Member
Licensed User
Longtime User
What is the exact reason why you push up this - FOUR years old - Thread?
Because I'm looking for examples

I don't know if the landlord has solved this problem. This is my solution, so I sent it out to everyone for reference
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
What is the exact reason why you push up this - FOUR years old - Thread?
Nostalgia.
And in any case, before answering a question, you need to think carefully in order to give correct advice. ?
 
Last edited:
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…