1

I have an overlay View that I attach directly to the WindowManager as described here: How is Facebook Chat Heads implemented?.

I would like this overlay View to be partially transparent and allow touchEvent to go through (so that users can interact with the Android UI below).

Is this somehow possible ? I'm guessing there might be some security considerations here but haven't been able to confirm this anywhere.

Community
  • 1
  • 1
mbonnin
  • 6,893
  • 3
  • 39
  • 55

2 Answers2

2

I would like this overlay View to be partially transparent

That's fine — that's merely a matter of what your View is (e.g., background).

and allow touchEvent to go through (so that users can interact with the Android UI below).

Fortunately, that is not possible, for obvious privacy and security reasons. What you are describing is called a tapjacking attack. Only one app gets the touch event, so if you get the touch event, your app consumes it.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

Actually you can use a library called standout to have your app overlay the screen.

Standout Library:

https://github.com/pingpongboss/StandOut

Should jump start you on your project!

  • The question was actually more about having TouchEvents falltrough, which is not possible. I'll edit the question. – mbonnin Apr 06 '16 at 16:13