Android Question Why does Panel_Touch event switch to using Absolute X,Y position for Action=3?

Widget

Well-Known Member
Licensed User
Longtime User
I wrote a custom view MyCV based on a panel and MyCV has a touch event that is handled internally by the class. Here is the standard Sub definition:

Private Sub paFront_Touch (Action As Int, X As Float, Y As Float) As Boolean

Everything works fine for Action=0 (Down), 1 (Up), 2 (Drag). The X & Y parameters passed to the Touch sub are relative to inside the paFront panel.

But when Action=3 (drag goes outside of the paFront panel), the X,Y parameters appears to be the absolute coordinates wrt the Activity. Why? Why is it not the coordinates relative to the class panel paFront as it always is for the other Actions? If the drag operation goes outside of the panel, the X,Y parameters should be something like (-10,-40) for upper left or (300,200) for lower right etc.. After all, it is the paFront_Touch event that is handling the event so X,Y should be relative to this panel. Why change the X,Y coordinate system from relative to absolute when the action is 3?

This creates a problem for me because the MyCV view is sometimes inside of a panel that is on a CustomListView. The MyCV does not know it is on a CustomListView, so it should not be expected to calculate the position of the CLV panel inside of the paFront_Touch event to get the relative coordinates.

All I need to know in this paFront_Touch event, is the relative position of X,Y for Action=3.
Is this a bug, or is it suppose to work this way?

TIA
 
Top