- Hiding the Status Bar
- This lesson teaches you to
- You should also read
- Try it out
- Hide the Status Bar on Android 4.0 and Lower
- Hide the Status Bar on Android 4.1 and Higher
- Make Content Appear Behind the Status Bar
- Synchronize the Status Bar with Action Bar Transition
- [GUIDE] [NO ROOT REQUIRED] Hide The Status Bar Or Nav Bar With ADB
- Breadcrumb
- TheFixItMan
- TheFixItMan
- Salvuchi
- mikedolo
- TheFixItMan
- How to Hide Android Status Bar Programmatically
- Android Example: Hiding Android StatusBar/NotificationBar Programmatically
- Method 1: Hiding Android StatusBar Using Java Code
- XML Layout File
- Java Activity File
- Method 2: Hiding Android Status Bar Using Theme Setting
- Выбираем приложение для модернизации статус-бара на android-устройствах: Super Status Bar, Omega StatusBar и Material Status Bar
- Оглавление
- Вступление
- реклама
- Как я сделал статус-бар на Android по кайфу
- Разрешения на Android
- Как можно заблокировать Android-смартфон
- Как изменить статус-бар на Android
Hiding the Status Bar
This lesson teaches you to
You should also read
Try it out
This lesson describes how to hide the status bar on different versions of Android. Hiding the status bar (and optionally, the navigation bar) lets the content use more of the display space, thereby providing a more immersive user experience.
Figure 1 shows an app with a visible status bar:
Figure 1. Visible status bar.
Figure 2 shows an app with a hidden status bar. Note that the action bar is hidden too. You should never show the action bar without the status bar.
Figure 2. Hidden status bar.
Hide the Status Bar on Android 4.0 and Lower
You can hide the status bar on Android 4.0 (API level 14) and lower by setting WindowManager flags. You can do this programmatically or by setting an activity theme in your app’s manifest file. Setting an activity theme in your app’s manifest file is the preferred approach if the status bar should always remain hidden in your app (though strictly speaking, you could programmatically override the theme if you wanted to). For example:
The advantages of using an activity theme are as follows:
- It’s easier to maintain and less error-prone than setting a flag programmatically.
- It results in smoother UI transitions, because the system has the information it needs to render your UI before instantiating your app’s main activity.
Alternatively, you can programmatically set WindowManager flags. This approach makes it easier to hide and show the status bar as the user interacts with your app:
When you set WindowManager flags (whether through an activity theme or programmatically), the flags remain in effect unless your app clears them.
You can use FLAG_LAYOUT_IN_SCREEN to set your activity layout to use the same screen area that’s available when you’ve enabled FLAG_FULLSCREEN . This prevents your content from resizing when the status bar hides and shows.
Hide the Status Bar on Android 4.1 and Higher
You can hide the status bar on Android 4.1 (API level 16) and higher by using setSystemUiVisibility() . setSystemUiVisibility() sets UI flags at the individual view level; these settings are aggregated to the window level. Using setSystemUiVisibility() to set UI flags gives you more granular control over the system bars than using WindowManager flags. This snippet hides the status bar:
Note the following:
- Once UI flags have been cleared (for example, by navigating away from the activity), your app needs to reset them if you want to hide the bars again. See Responding to UI Visibility Changes for a discussion of how to listen for UI visibility changes so that your app can respond accordingly.
- Where you set the UI flags makes a difference. If you hide the system bars in your activity’s onCreate() method and the user presses Home, the system bars will reappear. When the user reopens the activity, onCreate() won’t get called, so the system bars will remain visible. If you want system UI changes to persist as the user navigates in and out of your activity, set UI flags in onResume() or onWindowFocusChanged() .
- The method setSystemUiVisibility() only has an effect if the view you call it from is visible.
- Navigating away from the view causes flags set with setSystemUiVisibility() to be cleared.
Make Content Appear Behind the Status Bar
On Android 4.1 and higher, you can set your application’s content to appear behind the status bar, so that the content doesn’t resize as the status bar hides and shows. To do this, use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN . You may also need to use SYSTEM_UI_FLAG_LAYOUT_STABLE to help your app maintain a stable layout.
When you use this approach, it becomes your responsibility to ensure that critical parts of your app’s UI (for example, the built-in controls in a Maps application) don’t end up getting covered by system bars. This could make your app unusable. In most cases you can handle this by adding the android:fitsSystemWindows attribute to your XML layout file, set to true . This adjusts the padding of the parent ViewGroup to leave space for the system windows. This is sufficient for most applications.
In some cases, however, you may need to modify the default padding to get the desired layout for your app. To directly manipulate how your content lays out relative to the system bars (which occupy a space known as the window’s «content insets»), override fitSystemWindows(Rect insets) . The fitSystemWindows() method is called by the view hierarchy when the content insets for a window have changed, to allow the window to adjust its content accordingly. By overriding this method you can handle the insets (and hence your app’s layout) however you want.
Synchronize the Status Bar with Action Bar Transition
On Android 4.1 and higher, to avoid resizing your layout when the action bar hides and shows, you can enable overlay mode for the action bar. When in overlay mode, your activity layout uses all the space available as if the action bar is not there and the system draws the action bar in front of your layout. This obscures some of the layout at the top, but now when the action bar hides or appears, the system does not need to resize your layout and the transition is seamless.
To enable overlay mode for the action bar, you need to create a custom theme that extends an existing theme with an action bar and set the android:windowActionBarOverlay attribute to true . For more discussion of this topic, see Overlaying the Action Bar in the Adding the Action Bar class.
Then use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN , as described above, to set your activity layout to use the same screen area that’s available when you’ve enabled SYSTEM_UI_FLAG_FULLSCREEN . When you want to hide the system UI, use SYSTEM_UI_FLAG_FULLSCREEN . This also hides the action bar (because windowActionBarOverlay=”true”) and does so with a coordinated animation when both hiding and showing the two.
Источник
[GUIDE] [NO ROOT REQUIRED] Hide The Status Bar Or Nav Bar With ADB
Breadcrumb
TheFixItMan
Senior Member
To permanently hide Nav Bar for root users only see post 2
Note this only hides the Nav bar — swipe up gesture will show Nav bar and not all apps will honour the hidden status
Requirements
ADB setup on pc — see Here if you need to set it up
Moto USB phone driver installed
How To
Connect phone to laptop/pc via usb cable and make sure usb debugging is enabled
Open a command prompt or terminal window at your adb location (If you have adb in your environmental values then you can run this from anywhere)
The commands you’ll need are:
To only hide the status bar:
To only hide the navigation bar:
To hide both status and nav bar:
Return things to normal:
TheFixItMan
Senior Member
Requirements
Root
Root browser
Note — not all roms will support this change
First check to see if the rom supports expanded desktop which will do the job for you either globally or on a per app basis
Instructions
Set up all your gestures before continuing
Copy build.prop from /system to sd card and rename build.prop-backup using a root browser
Copy build.prop to any folder on internal stoeage
Open build.prop file you have placed in internal storage
Add the following line at the end of build.prop
Salvuchi
Member
I wanted to contribute with my findings. This command: «adb shell settings put global policy_control immersive.status=*» hides the status bar in all apps, but some of them get bugged, for example in Instagram you can’t see the text field when replying on a story, or Twitter doesn’t display the bottom part where you can insert pictures to your post while typing.
I discovered that if you type «adb shell settings put global policy_control immersive.status=apps,» then Instagram works fine without the status bar, and of course you could add twitter after that to exclude twitter.
But this is a bit random, I don’t know exactly why Instagram gets fixed by this and I wonder if there is a way to fix other apps.
mikedolo
Senior Member
TheFixItMan
Senior Member
No — not unless you create your own mod and add it to the settings apk
Use the adb command to return things to normal
Источник
How to Hide Android Status Bar Programmatically
Most of the android applications show the status bar while running the app. Some of the apps need full screen and they hide the status bar. Mainly android games hide the status bar because they need more space. If you don’t want to show android status bar in your application, this tutorial teaches you to hide and show android status bar/notification bar programmatically.
Android Example: Hiding Android StatusBar/NotificationBar Programmatically
Following are the two different methods to hide android status bar programmatically.
Method 1: Hiding Android StatusBar Using Java Code
Following is the code of java activity file and XML layout file to hide and show status bar/ notification bar.
XML Layout File
Java Activity File
If you are going to hide status bar at runtime you can add getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); before setContentView of onCreate method.
Method 2: Hiding Android Status Bar Using Theme Setting
You can also hide android status bar/ notification bar on android 4.0 (API level 14) and lower using theme setting. Following is the code of res/values/styles.xml file. You can also set theme directly from AndroidManifest.xml file and this is also hide your app actionbar/appbar.
res/values/styles.xml
Now, run your How to Hide and Show Android Status Bar Programmatically application, status bar is disabled now.
Источник
Выбираем приложение для модернизации статус-бара на android-устройствах: Super Status Bar, Omega StatusBar и Material Status Bar
Оглавление
Вступление
Внешний вид OC Android меняется очень неспешно, при этом количество параметров по настройке оформления оставляет желать лучшего. Благо операционная система является открытой и для нее существует множество приложений, в числе которых есть и решения, предназначенные для изменения внешнего вида.
реклама
С выбором лучшей оболочки для android-устройств мы уже разобрались, да и обзор приложений с обоями тоже был. Что же еще можно изменить в интерфейсе системы? Помимо значков и иконок можно изменить «статус-бар».
В данном материале мы познакомимся с тремя приложениями. Два из них – Super Status Bar и Omega StatusBar – ветераны данной категории, которые появились в далеких 2011-2012 годах, третье – Material Status Bar – современное решение. Дадут ли «ветераны» отпор новичку или все-таки года берут свое? Рассмотрим всех участников внимательнее и сделаем конкретные выводы в каждом случае.
В качестве тестового оборудования использовались следующие устройства: смартфоны Xiaomi Redmi Note 3 Pro (OC Android 6.0.1, MIUI 8, процессор Snapdragon 650 64 бит, 6 х 1800 МГц, видеосопроцессор Adreno 510, 2 Гбайта ОЗУ) и Jinga Basco M500 3G (OC Android 5.1, процессор MediaTek MT6580, 4 х 1300 МГц, видеосопроцессор Mali-400 MP2, 1 Гбайт ОЗУ), планшет Samsung Galaxy Tab 2 7.0 (CM 13 на базе OC Android 6.0.1, процессор TI OMAP 4430, 2 x 1200 МГц, видеосопроцессор PowerVR 540, 384 МГц, 1 Гбайт ОЗУ).
Источник
Как я сделал статус-бар на Android по кайфу
Для меня кастомизация Android всегда была чем-то далёким и откровенно гиковским. Ну зачем, думал я, что-то менять, если разработчики – явно неглупые люди – всё уже продумали за меня? Долгое время меня вполне устраивала моя позиция, и желания что-либо менять в интерфейсе своего смартфона у меня не было, тем более что обычно для этого приходилось что-то перепрошивать или устанавливать сторонние моды. Однако я немного изменил своё отношение к такому явлению, как кастомизация, когда познакомился с приложением Super Status Bar.
Не устраивает статус-бар на Android? Кастомизируйте его
Это приложение, как ясно из названия, позволяет настроить статус-бар Android-смартфона так, как хочется именно вам. На самом деле сначала меня привлекла только функция блокировки смартфона по двойному нажатию на верхнюю часть экрана, однако довольно быстро стало понятно, что эта программа может сильно улучшить такой незначительный, на первый взгляд, компонент операционной системы, как статус-бар.
Разрешения на Android
Приложение запросит две привилегии — дайте их
Для начала вам потребуется дать Super Status Bar две привилегии: возможность изменять настройки и открыть доступ к службе специальных возможностей. Это необходимо для того, чтобы приложение смогло вносить изменения в статус-бар и расширить его функциональность.
После того, как разрешения будут даны, вернитесь на домашний экран. Здесь вы увидите 7 вкладок, в которых скрываются настройки статус-бара. Забегая вперёд, скажу, что не советую включать сразу все параметры, во-первых, чтобы не запутаться, а, во-вторых, чтобы не перегрузить его.
Как можно заблокировать Android-смартфон
Первое, что я сделал, это включил возможность блокировать смартфон по двойному тапу на статус-бар. Для этого откройте вкладку «Жесты» — «Двойное нажатие» и активируйте параметр «Выключить экран». После этого вы сможете быстро и непринуждённо гасить экран, не задействуя физическую клавишу питания. Это очень удобно в ситуациях, когда смартфон лежит на столе, а возможности взять его в руки по какой-то причине у вас нет, либо если боковая клавиша включения и выключения сломалась.
Управлять статус-баром при помощи жестов реально удобно
Затем я настроил изменение яркости дисплея жестом скольжения вправо или влево по статус-бару. Как оказалось, это очень классная возможность, которой мне очень давно не хватало, ведь в помещении мне всегда было много максимальной яркости моего Honor View 20, и мало – на улице. Для активации этого механизма перейдите во вкладку «Жесты» и включите параметр «Скольжение». Здесь же можно настроить вызов конкретных приложений с помощью жестов, но, на мой взгляд, это было бы уже чересчур.
Как изменить статус-бар на Android
На Android можно заменить привычный статус-бар на решение из iOS
Скажу честно, мне никогда не нравились иконки в статус-баре на Android и всегда нравилась реализация iOS. Поэтому для меня стал позитивным открытие тот факт, что Super Status Bar позволяет заменить классический статус-бар Android решением, используемым в iOS. Для этого перейдите во вкладку «Статус-бар» — «Стиль» и выберите понравившийся. Кроме iOS, тут есть статус-бары из Android 10, Android 9 Pie и MIUI. Правда, учитывайте, что такая рокировка доступна только в платной версии приложения, за которую придётся заплатить 189 рублей.
Как на Android переключать песни длительным нажатием на кнопки регулировки громкости
Если вам не нравится, как реализованы уведомления на Android, Super Status Bar и тут придёт вам на помощь. Он позволяет заблокировать появление всплывающих окон с оповещениями, заменив их бегущей строкой с содержимым послания. Для этого откройте вкладку «Текст в строке» и включите параметр «Бегущий текст в статус-баре». Тут же можно настроить скорость анимации бегущего текста, начальную задержку перед его появлением, изменить фон, на котором он будет появляться и настроить стилистику появления текста.
Уведомления бегущей строкой воспринимаются реально удобнее
Super Status Bar – их тех приложений, которые запускаются один раз. А ведь и правда, если можно сразу настроить все конфигурации статус-бара, то зачем открывать его повторно и вносить какие-то изменения? По крайней мере, я так решил для себя, включив все нужные мне параметры. Попробуйте и вы. Думаю, вам понравится.
Источник