Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block/Disable Statusbar in android Tablet/Mobile

I have seen Kioware and SureLock applications. They simply block every control in tablet. I'm aware about overriding back button and handling the home and recent task options as well. But I'm not sure how they managed to control the setting option on system bar. Settings appear for a fraction of seconds and then disappear. In the same way Statusbar of mobile which appear on swipe down need to be block.

If anyone have idea about it please share it. Any guidance/help is appreciated.

See the attached image selected portion which I need to block/disable

like image 561
Naresh Sharma Avatar asked Nov 06 '15 18:11

Naresh Sharma


People also ask

How do I hide app status bar?

Once you're in the app settings, you'll notice the “Notifications” submenu. Open it. There you'll see a ton of notification options on a system level. You can basically choose to minimize status bar notifications for one particular type of notification.

How do I hide the bars on my Android?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


1 Answers

You can try to add a transparent View at desidered position using the WindowManager (follow this example). In this way, you will intercept any tap events from the user.

Be sure to set the proper flags/type, because you need to overlay the system bars:

    WindowManager.LayoutParams dismissParams = new WindowManager.LayoutParams(
                        viewWidth,
                        viewHeight,
                        WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, //you can also try with TYPE_SYSTEM_OVERLAY, TYPE_SYSTEM_ERROR
                        WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
                        PixelFormat.TRANSPARENT);
like image 137
bonnyz Avatar answered Oct 11 '22 03:10

bonnyz