Android overlay (API 19) - how to cover bottom parts of SW buttons as well?

305 views Asked by At

I'm adding an overlay view over the home screen using:

((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).addView(this, layoutParams);

Layout params are defined as follows:

layoutParams = new WindowManager.LayoutParams(
        WindowManager.LayoutParams.MATCH_PARENT,
        WindowManager.LayoutParams.MATCH_PARENT,
        WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
        WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
                | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                | WindowManager.LayoutParams.FLAG_FULLSCREEN
                | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
        PixelFormat.TRANSLUCENT);

The overlay covers entire screen besides the bottom part of the SW buttons (home, back and multitasking buttons). Any idea how to make the overlay cover those parts as well, so that my overlay will treat events of those buttons as well?

1

There are 1 answers

0
hiddeneyes02 On

Late I know, but someone can try this :

getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, 
            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);