Search code examples
androidtouchoverlayandroid-navigation-bar

Overlay layout that go over Navigation Bar Android 7+


I'm trying to do an Accessibility Service where the purpose it's to create some "layer" between the user when he touches the screen and the tap.

For example : when I touch the screen I when to double tap at this precise position I touch the Screen.

I think, but I'm really open to suggestion, that I will have to create an invisible layout that will cover all the screen where a would be able to activate an onTouchListener to get the position and use my accessibility service to create gesture and transfer the touch behind the layout to click anywhere.

As far I only found a solution for Android 4.1 or less.

I also want to use a kind of cursor, the app Open Sesame do it well and the cursor can go over the navigation bar and interact with.

I also found the open source project Eva facial mouse but they don't perform complex gesture and don't go over the navigation bar.

So my big question is, I am in the right way by wanting to create an invisible layout to detect touch even on the navigation bar and is there someone would help me to enlighten my search in the right direction.


Solution

  • I succeed in putting an overlay layout over the status bar, just add the right Flags to your LayoutParams.

    For my case I use: FLAG_FULLSCREEN, FLAG_LAYOUT_IN_SCREEN and FLAG_LAYOUT_NO_LIMITS.