Android Question Touch event on Panel[Solved]

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All

I am am using a transparent panel [Touch and Move events] on top of an Edittext to detect finger swipes and horizontal scoll the text. Unfortunately the panel is not registering the touch event.

The panel was created, sized and positioned in the designer.
Below is the relevant code, the entire project too large to upload. I have searched the forums and found posts that appear to show I am doing it right. ????

Any help appreciated.

Regards Roger
B4X:
Sub AddReviewPnl_Touch (Action As Int, X As Float, Y As Float) As Boolean             'Return True to consume the event   
Log("Touch")
    Select Action
        Case AddReviewPnl.ACTION_DOWN
Log("Down")
            XStart = X
        Case AddReviewPnl.ACTION_MOVE
Log("Move")
            XMove = X-XStart
            If Idisplay.Text.Length>14 Then
                If Abs(XMove) > Idisplay.Width/15 Then
                    XMove = Round2((XMove/15),0)                                    'Changes XMove from pixels to Chars
                    Log("XMove = "&XMove)
                    CurrentStart = Idisplay.SelectionStart
                    If XMove < 0 Then
                        Idisplay.SelectionStart = Max(CurrentStart+XMove, Idisplay.Text.Length - 10)
                    Else
                        Idisplay.SelectionStart = Min(CurrentStart+XMove, Idisplay.Text.Length)
                    End If
                End If
            End If
        Case AddReviewPnl.ACTION_UP
Log("up")
    End Select
    Return True
End Sub
 
Top