D
D
Dariek2016-07-27 15:54:11
Android
Dariek, 2016-07-27 15:54:11

How to remove status bar in android 5-6?

We are talking about the topmost bar with a clock, battery charge, etc.
Switching to full screen mode is not a problem, the problem is that it still appears on the swipe, albeit transparent. How can I remove it or how can I change its height?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dariek, 2016-10-19
@Dariek

In general, I decided everything with a crutch. The bottom line is this:
I make a custom view that draws background and place it on the top, system level.
Formally, this does not prevent the status of the bar from being displayed by swiping, but the custom view to the size of the bar overrides it. There are no visual artifacts or freezes. But the solution, of course, is a crutch, valid only taking into account a piece-by-piece solution for specific two devices.
The code for drawing on top is something like this:

WindowManager.LayoutParams mLP = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.MATCH_PARENT,
                statusBarHeight,
                WindowManager.LayoutParams.TYPE_SYSTEM_ERROR,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
                        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |
                        WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
                PixelFormat.TRANSLUCENT);

        mLP.gravity = Gravity.TOP | Gravity.CENTER;

        WindowManager mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
        mWindowManager.addView(myCustomView, mLP);

A
Alexey Perelygin, 2016-07-29
@orcDamnar

well, you can intercept the touch and not give it further, as an option. Or block the swipe, by touch it should not work.

A
Alexey, 2016-08-06
@VDG

The window must be of type TYPE_SYSTEM_ERROR . It will cover the status bar, swipe will not work, and this window will catch touches. But such a window has another problem, it does not run over the navigation bar on devices with virtual buttons. And still, the navigation bar can be reached with a swipe from the bottom.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question