Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide status bar in AOSP build

I'd like to hide/remove the status bar (i.e the top bar containing clock, notifications,...) in my custom AOSP image.

Do you know if it's practically possible ? And how ?

like image 975
sdabet Avatar asked Sep 08 '17 12:09

sdabet


People also ask

Which command is used to hide and display status bar?

View decorView = getWindow(). getDecorView(); // Hide the status bar.

How do I hide kotlin status bar?

To hide status bar in Android using Kotlin, we can request that the visibility of the status bar or other screen/window decorations be changed by setting window. decorView. systemUiVisibility with View. SYSTEM_UI_FLAG_FULLSCREEN in the Activity Kotlin file.


1 Answers

The status bar layout is defined in frameworks/base/packages/SystemUI/res/layout/status_bar.xml:

<com.android.systemui.statusbar.phone.PhoneStatusBarView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
    android:layout_width="match_parent"
    android:layout_height="@dimen/status_bar_height"
    android:id="@+id/status_bar"
    android:background="@drawable/system_bar_background"
    android:orientation="vertical"
    android:focusable="false"
    android:descendantFocusability="afterDescendants"
    >

    <!-- […] -->

</com.android.systemui.statusbar.phone.PhoneStatusBarView>

You could try to set the height of com.android.systemui.statusbar.phone.PhoneStatusBarView to 0dp (defined by status_bar_height in frameworks/base/core/res/res/values/dimens.xml) or its visibility to gone.

Here is a link to a guide on xda-developers that explains how to "hack" SystemUI.apk and framework-res.apk to hide the status bar: [GUIDE] Hide Status Bar and still being able to expand it on Jelly Bean. It may be useful to know which resources to modify.

like image 199
Bruno Parmentier Avatar answered Sep 28 '22 12:09

Bruno Parmentier