I need to put an overlay Window precisely over a certain element of a third-party app, pixel by pixel or nearly so.
I'm aware of:
//.............
appOverlayLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;
appOverlayLayoutParams.x = 100;
appOverlayLayoutParams.y = 100;
//.............
However, this won't place an overlay window precisely where I'll need because the coordinates are static.
How will I do it? How to make them dynamic? How to get the ones of an element? Assuming that I've it in onAccessibilityEvent(AccessibilityEvent e) { .... }
I'd also prefer an overlay window to follow an element if and when it gets scrolled.