• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Statusbar Size Fix

Search This thread

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
I have: Device default (what i'm using), Corner cutout, Double cutout, and Tall cutout
Statusbar height is found in the res/values/dimens.xl in both the SystemUI and framework. The one in the SystemUI refers back to the one in the framework. The problem being, it doesn't appear to be the statusbar height that needs changed. It might be some padding height that is above and/or below the statusbar.
 

anonxlg

Senior Member
Sep 3, 2011
365
31
I don't have a /values/ folder in /res/ nor is there any dimen* file.

This is the /res/value/status_bar.xml in the systemui.apk, which I see: android: paddingBottom="2dp"
Code:
<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:orientation="1" android:id="resourceId:0x7f0a0383" android:background="resourceId:0x7f08040a" android:focusable="false" android:descendantFocusability="1" android:layout_width="-1" android:layout_height="resourceId:0x7f07038b" android:accessibilityPaneTitle="resourceId:0x7f11055e">
<ImageView android:id="resourceId:0x7f0a029b" android:paddingBottom="2dp" android:visibility="2" android:layout_width="resourceId:0x7f070392" android:layout_height="-1" android:src="resourceId:0x7f080310" android:scaleType="5" android:paddingStart="resourceId:0x7f070396"/>
<LinearLayout android:orientation="0" android:id="resourceId:0x7f0a0385" android:paddingTop="resourceId:0x7f070397" android:layout_width="-1" android:layout_height="-1" android:paddingStart="resourceId:0x7f070396" android:paddingEnd="resourceId:0x7f070395">
    <FrameLayout android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0">
        <include layout="resourceId:0x7f0d005b"/>
            <LinearLayout android:id="resourceId:0x7f0a0387" android:clipChildren="false" android:layout_width="-1" android:layout_height="-1">
                <ViewStub android:id="resourceId:0x7f0a02b2" android:layout="resourceId:0x7f0d00f3" android:layout_width="-2" android:layout_height="-1"/>
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="resourceId:0x7f1201a3" android:gravity="0x800013" android:id="resourceId:0x7f0a00f1" android:layout_width="-2" android:layout_height="-1" android:singleLine="true" android:paddingStart="resourceId:0x7f070394" android:paddingEnd="resourceId:0x7f070393"/>
                <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="0" android:id="resourceId:0x7f0a0299" android:clipChildren="false" android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0"/>
            </LinearLayout>
    </FrameLayout>
    <android.widget.Space android:gravity="0x11" android:id="resourceId:0x7f0a0113" android:layout_width="0dp" android:layout_height="-1"/>
    <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:gravity="0x11" android:orientation="0" android:id="resourceId:0x7f0a00e3" android:clipChildren="false" android:layout_width="-2" android:layout_height="-1"/>
    <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="0x800015" android:orientation="0" android:id="resourceId:0x7f0a0394" android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0">
    <include layout="resourceId:0x7f0d0162"/>
    </com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="resourceId:0x7f0a0148" android:layout="resourceId:0x7f0d004a" android:layout_width="-2" android:layout_height="-1"/>
</com.android.systemui.statusbar.phone.PhoneStatusBarVie

apologies to going off topic on your thread btw, essential phone part of the forum is pretty much dead
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
I don't have a /values/ folder in /res/ nor is there any dimen* file.

This is the /res/value/status_bar.xml in the systemui.apk, which I see: android: paddingBottom="2dp"
Code:
<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:orientation="1" android:id="resourceId:0x7f0a0383" android:background="resourceId:0x7f08040a" android:focusable="false" android:descendantFocusability="1" android:layout_width="-1" android:layout_height="resourceId:0x7f07038b" android:accessibilityPaneTitle="resourceId:0x7f11055e">
<ImageView android:id="resourceId:0x7f0a029b" android:paddingBottom="2dp" android:visibility="2" android:layout_width="resourceId:0x7f070392" android:layout_height="-1" android:src="resourceId:0x7f080310" android:scaleType="5" android:paddingStart="resourceId:0x7f070396"/>
<LinearLayout android:orientation="0" android:id="resourceId:0x7f0a0385" android:paddingTop="resourceId:0x7f070397" android:layout_width="-1" android:layout_height="-1" android:paddingStart="resourceId:0x7f070396" android:paddingEnd="resourceId:0x7f070395">
    <FrameLayout android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0">
        <include layout="resourceId:0x7f0d005b"/>
            <LinearLayout android:id="resourceId:0x7f0a0387" android:clipChildren="false" android:layout_width="-1" android:layout_height="-1">
                <ViewStub android:id="resourceId:0x7f0a02b2" android:layout="resourceId:0x7f0d00f3" android:layout_width="-2" android:layout_height="-1"/>
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="resourceId:0x7f1201a3" android:gravity="0x800013" android:id="resourceId:0x7f0a00f1" android:layout_width="-2" android:layout_height="-1" android:singleLine="true" android:paddingStart="resourceId:0x7f070394" android:paddingEnd="resourceId:0x7f070393"/>
                <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="0" android:id="resourceId:0x7f0a0299" android:clipChildren="false" android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0"/>
            </LinearLayout>
    </FrameLayout>
    <android.widget.Space android:gravity="0x11" android:id="resourceId:0x7f0a0113" android:layout_width="0dp" android:layout_height="-1"/>
    <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:gravity="0x11" android:orientation="0" android:id="resourceId:0x7f0a00e3" android:clipChildren="false" android:layout_width="-2" android:layout_height="-1"/>
    <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="0x800015" android:orientation="0" android:id="resourceId:0x7f0a0394" android:layout_width="0dp" android:layout_height="-1" android:layout_weight="1.0">
    <include layout="resourceId:0x7f0d0162"/>
    </com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="resourceId:0x7f0a0148" android:layout="resourceId:0x7f0d004a" android:layout_width="-2" android:layout_height="-1"/>
</com.android.systemui.statusbar.phone.PhoneStatusBarVie

apologies to going off topic on your thread btw, essential phone part of the forum is pretty much dead
You didn't decompile your SystemUI. All you did is unzip it.
 

anonxlg

Senior Member
Sep 3, 2011
365
31
ctrl+f all the 'status' entries:

\SystemUI\res\values\dimens.xml:
Code:
Line 175:     <dimen name="car_status_bar_header_height">128.0dip</dimen>
Line 249:     <dimen name="heads_up_status_bar_padding">8.0dip</dimen>
Line 289:     <dimen name="kg_status_line_font_size">14.0sp</dimen>
Line 695:     <item type="dimen" name="ongoing_appops_chip_icon_size">@dimen/status_bar_icon_drawing_size</item>
Line 783:     <item type="dimen" name="qs_header_alarm_icon_size">@dimen/status_bar_icon_drawing_size</item>
Line 788:     <item type="dimen" name="qs_header_mobile_icon_size">@dimen/status_bar_icon_drawing_size</item>
Line 807:     <dimen name="qs_status_separator">32.0dip</dimen>
Line 880:     <dimen name="status_bar_airplane_spacer_width">4.0dip</dimen>
Line 881:     <dimen name="status_bar_battery_icon_height">13.0dip</dimen>
Line 882:     <dimen name="status_bar_battery_icon_width">7.799988dip</dimen>
Line 883:     <dimen name="status_bar_clock_end_padding">0.0dip</dimen>
Line 884:     <dimen name="status_bar_clock_size">14.0sp</dimen>
Line 885:     <dimen name="status_bar_clock_starting_padding">7.0dip</dimen>
Line 886:     <dimen name="status_bar_connected_device_bt_indicator_size">17.0dip</dimen>
Line 887:     <dimen name="status_bar_connected_device_signal_margin_end">16.0dip</dimen>
Line 888:     <dimen name="status_bar_header_height_expanded">124.0dip</dimen>
Line 889:     <dimen name="status_bar_header_height_keyguard">40.0dip</dimen>
Line 890:     <dimen name="status_bar_header_padding_bottom">48.0dip</dimen>
Line 891:     <item type="dimen" name="status_bar_height">@android:dimen/progress_bar_size_medium</item>
Line 892:     <dimen name="status_bar_horizontal_padding">2.5dip</dimen>
Line 893:     <item type="dimen" name="status_bar_icon_drawing_alpha">90.0%</item>
Line 894:     <dimen name="status_bar_icon_drawing_size">15.0dip</dimen>
Line 895:     <item type="dimen" name="status_bar_icon_drawing_size_dark">@android:dimen/navigation_bar_frame_height</item>
Line 896:     <dimen name="status_bar_icon_padding">0.0dip</dimen>
Line 897:     <item type="dimen" name="status_bar_icon_scale_factor">1.0</item>
Line 898:     <item type="dimen" name="status_bar_icon_size">@android:dimen/quick_qs_total_height</item>
Line 899:     <dimen name="status_bar_left_clock_end_padding">7.0dip</dimen>
Line 900:     <dimen name="status_bar_left_clock_starting_padding">0.0dip</dimen>
Line 901:     <dimen name="status_bar_padding_end">8.0dip</dimen>
Line 902:     <dimen name="status_bar_padding_start">8.0dip</dimen>
Line 903:     <dimen name="status_bar_padding_top">0.0dip</dimen>
Line 904:     <item type="dimen" name="status_bar_wifi_signal_size">@android:dimen/resize_shadow_size</item>
Line 905:     <dimen name="status_bar_wifi_signal_spacer_width">2.5dip</dimen>

\framework-res\res\values\dimens.xml:
Code:
Line 311:     <dimen name="keyguard_lockscreen_status_line_clockfont_bottom_margin">12.0dip</dimen>
Line 312:     <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">22.0dip</dimen>
Line 313:     <dimen name="keyguard_lockscreen_status_line_font_right_margin">42.0dip</dimen>
Line 314:     <dimen name="keyguard_lockscreen_status_line_font_size">14.0dip</dimen>
Line 329:     <dimen name="kg_status_clock_font_size">75.0dip</dimen>
Line 330:     <dimen name="kg_status_date_font_size">15.0dip</dimen>
Line 331:     <dimen name="kg_status_line_font_right_margin">16.0dip</dimen>
Line 332:     <dimen name="kg_status_line_font_size">13.0dip</dimen>
Line 516:     <dimen name="status_bar_content_number_size">48.0sp</dimen>
Line 517:     <dimen name="status_bar_edge_ignore">5.0dip</dimen>
Line 518:     <item type="dimen" name="status_bar_height">@dimen/status_bar_height_portrait</item>
Line 518:     <item type="dimen" name="status_bar_height">@dimen/status_bar_height_portrait</item>
Line 519:     <dimen name="status_bar_height_landscape">28.0dip</dimen>
Line 520:     <dimen name="status_bar_height_portrait">144.0px</dimen>
Line 521:     <dimen name="status_bar_icon_size">22.0dip</dimen>
Line 522:     <dimen name="status_bar_system_icon_intrinsic_size">17.0dip</dimen>
Line 523:     <dimen name="status_bar_system_icon_size">15.0dip</dimen>

Most promising entries, to me, are:
Line 519: <dimen name="status_bar_height_landscape">28.0dip</dimen>
Line 520: <dimen name="status_bar_height_portrait">144.0px</dimen>
In the framework apk, but you mentioned it's more likely it's a padding modifier, in while case, in systemui apk:
Line 890: <dimen name="status_bar_header_padding_bottom">48.0dip</dimen>
Line 891: <item type="dimen" name="status_bar_height">@android:dimen/progress_bar_size_medium</item>
Line 892: <dimen name="status_bar_horizontal_padding">2.5dip</dimen>
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
ctrl+f all the 'status' entries:

\SystemUI\res\values\dimens.xml:


\framework-res\res\values\dimens.xml:


Most promising entries, to me, are:
Line 519: <dimen name="status_bar_height_landscape">28.0dip</dimen>
Line 520: <dimen name="status_bar_height_portrait">144.0px</dimen>
In the framework apk, but you mentioned it's more likely it's a padding modifier, in while case, in systemui apk:
Line 890: <dimen name="status_bar_header_padding_bottom">48.0dip</dimen>
Line 891: <item type="dimen" name="status_bar_height">@android:dimen/progress_bar_size_medium</item>
Line 892: <dimen name="status_bar_horizontal_padding">2.5dip</dimen>
You'll just have to try them. It's trial and error.
 

anonxlg

Senior Member
Sep 3, 2011
365
31
Before taking my question else where, do you know if possible to create a magisk module to just modify said value *inside* the apk.
Otherwise, I would just modify the xml file, recompile it back to apk, reboot to recovery, and manually replacing the target apks (not even sure if this is okay, ie-> is this even allowed in android -> passing safetynet?)
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
Before taking my question else where, do you know if possible to create a magisk module to just modify said value *inside* the apk.
Otherwise, I would just modify the xml file, recompile it back to apk, reboot to recovery, and manually replacing the target apks (not even sure if this is okay, ie-> is this even allowed in android -> passing safetynet?)
I can make you one but you'll still have to edit, then recompile. After you recompile, then you unzip the apk and put the contents into my module. Did your SystemUI come from system/priv-app or system/product/priv-app?
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
/system/product/priv-app/SystemUI/SystemUI.apk

Thanks for the help
You are welcome to try this. You modified files would go in the vrtheme/system/framework/framework-res.apk and/or vrtheme/system/product/priv-app/SystemUI/SystemUI.apk folders. Don't include meta-inf folder or androidmanifest.xml. Any mods done to files in the values folder (like dimens.xml) are lumped into the resources.arsc file. If you aren't going to modify the framework, delete the vrtheme/system/framework folder. Don't just leave them empty.
 

Attachments

  • mymagisk.zip
    2.4 MB · Views: 16
  • Like
Reactions: andybones

alexmeo

Member
Feb 12, 2008
35
4
Hi, I've asked you already to make the module for Lineage OS, but it updates almost every week, and they do the modifications in systemUI and framework-res files in this updates. So the old module causes bootloops. I understand the it takes time and is inconvenient to make every time new module, so maybe with your one time help I can modify the module every time so it fits new updates of Lineage OS?

P.s. because your module is really must-have
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
Hi, I've asked you already to make the module for Lineage OS, but it updates almost every week, and they do the modifications in systemUI and framework-res files in this updates. So the old module causes bootloops. I understand the it takes time and is inconvenient to make every time new module, so maybe with your one time help I can modify the module every time so it fits new updates of Lineage OS?

P.s. because your module is really must-have
Can you run bash script?

If you will give me the framework-res.apk and Systemui.apk again i might be able to give you a module that will last longer.
 
Last edited:

alexmeo

Member
Feb 12, 2008
35
4
Can you run bash script?

If you will give me the framework-res.apk and Systemui.apk again i might be able to give you a module that will last longer.
I've never run bash scripts, but I've googled how to do it and already have terminal apk. If there are some special commands or a place to run scripts from than please specify them. Here are systemUI and framework-res files.
 

Attachments

  • SystemUI.apk
    25 MB · Views: 6
  • framework-res.apk
    46.3 MB · Views: 6

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
I've never run bash scripts, but I've googled how to do it and already have terminal apk. If there are some special commands or a place to run scripts from than please specify them. Here are systemUI and framework-res files.
Unzip this onto your "c" drive. Drop your framework-res.apk, SystemUI.apk, and Displaycutoutemulationwaterfalloverlay.apk into folder. Open a bash script terminal from within the folder and copy the script from the readme.txt and run it. You need to have java jdk installed as well. Results will be in the done folder.

Before you run this each time, delete the framework-3Custom11script folder so that the new framework is installed.

Here is the new module.
 

Attachments

  • 3Custom11script.zip
    38.7 MB · Views: 38
  • LCwaterfall36.zip
    2.5 MB · Views: 15
Last edited:

alexmeo

Member
Feb 12, 2008
35
4
Unzip this onto your "c" drive. Drop your framework-res.apk, SystemUI.apk, and Displaycutoutemulationwaterfalloverlay.apk into folder. Open a bash script terminal from within the folder and copy the script from the readme.txt and run it. You need to have java jdk installed as well. Results will be in the done folder.

Before you run this each time, delete the framework-3Custom11script folder so that the new framework is installed.

Here is the new module.
I haven't tried yet to make module but using yours cause left notifications to go behind the camera.
And the question, as I understand I have to run script in Windows in cmd? Do I have to run apktool.bat? Or just bash script called LCwaterfall36?
 

Attachments

  • Screenshot_20210920-210032_Trebuchet.png
    Screenshot_20210920-210032_Trebuchet.png
    22.5 KB · Views: 10

Tulsadiver

Recognized Contributor
Jul 11, 2013
8,561
6,079
I haven't tried yet to make module but using yours cause left notifications to go behind the camera.
And the question, as I understand I have to run script in Windows in cmd? Do I have to run apktool.bat? Or just bash script called LCwaterfall36?
Just run the script that is in readme.txt file in a bash cmd window. I use GIT.
 

Top Liked Posts

  • 1
    I edit the SystemUIGoogle.apk as follows:

    res/values/dimens.xml
    From: <dimen name="status_bar_left_clock_starting_padding">0.0dip</dimen>

    To: <dimen name="status_bar_left_clock_starting_padding">30.0dip</dimen>

    res/layout/keyguard_status_bar.xml
    Find code:
    "android:id="@iD/keyguard_carrier_text"'

    Add padding after it like so:

    'android:id="@iD/keyguard_carrier_text" android:paddingLeft="30.0dip"'

    Smiley face comes from colon p
    Thank you so very much for sharing!
    1
    I think this is normal behavior for downloads. I took a screen record, but I'm not sure exactly how to take any screenshot/record that shows the cutout, so basically just imagine the cut out is directly behind the download icon, and any other notification icon for example in YouTube. The green highlights what can't be seen.

    I wonder if a padding is needed inside one of the layouts that is for notifications? But I'm very terrible at trying to figure it out.

    If I use 24dip I can see a little bit of the icon above the punch hole, because the status bar is so small. I prefer 36dip, but beggars can't be choosers. :)

    Thank you so much again for all that you do for the community.
    Could it have something to do with your custom rom? My downloads are to the right of my clock.
    1
    Good question. crDroid is based off AOSP like Pixels though. When I download something from say your OP through the browser that download icon IS to the right.. but for all my incoming notifications like say a text message, the icon is to the left while it's incoming, but once it's done it's back over to the right. So it's back n forth for things. Another example is when an email or text message is incoming, the icon is to the left of the date, like in my video, but once the notification has come in it moves over to the right. I do believe this is normal behavior, but would need someone to confirm. So, it's not enough of a bug to go back to the horrendous stock large status bar, but can be quite annoying when using the phone and the notification comes in. YouTube you can really see it.. Well YouTube Vanced anyway when going from video to the home screen.

    If you have a chance would you mind try downloading something from the Playstore and see if it is like my video with the download icon over to the left of the clock, please.
    Just for peace of mind. :)
    I did. Mine starts and stays to the right of the clock....
  • 3
    Android 12 mods have been uploaded.
    2
    Hi, looking to do this for a Samsung s10...
    Would you or someone be able to just provide a tutorial in generating our own? I'm fairly capable, and love to be able to build my own updates
    You need to modify your DisplayCutoutEmulationWaterfallOverlay.apk from your system/product/overlay folder.

    Decompile and edit:

    in res/values/dimens.xml

    1. Change these two from whatever their original codes are, to whatever size you want your statusbar to be:
    From: <dimen name="status_bar_height_landscape">48.0dip</dimen>
    To: <dimen name="status_bar_height_landscape">36.0dip</dimen>

    From: <dimen name="status_bar_height_portrait">28.0dip</dimen>
    To: <dimen name="status_bar_height_portrait">36.0dip</dimen>

    Also in res/values/dimens.xml

    2. Change these two to zero dip
    From: <dimen name="waterfall_display_left_edge_size">20.0dip</dimen>
    To: <dimen name="waterfall_display_left_edge_size">0.0dip</dimen>

    From: <dimen name="waterfall_display_right_edge_size">20.0dip</dimen>
    To: <dimen name="waterfall_display_right_edge_size">0.0dip</dimen>

    Recompile and put into a Module and flash. Then, in settings/system/developer options, select Waterfall cutout option in the Display cutout options menu.
    2
    Bummer, so do we have any options for reducing the status bar height on 12?
    Yes, as soon as I can get these updated to 12.
    1
    Did you choose the waterfall cutout option in settings/system/developer settings?
    Sorry, that was it.

    I love it, it has put me the games full screen in portrait and landscape. Brilliant.

    Thanks.
    1
    Good question. crDroid is based off AOSP like Pixels though. When I download something from say your OP through the browser that download icon IS to the right.. but for all my incoming notifications like say a text message, the icon is to the left while it's incoming, but once it's done it's back over to the right. So it's back n forth for things. Another example is when an email or text message is incoming, the icon is to the left of the date, like in my video, but once the notification has come in it moves over to the right. I do believe this is normal behavior, but would need someone to confirm. So, it's not enough of a bug to go back to the horrendous stock large status bar, but can be quite annoying when using the phone and the notification comes in. YouTube you can really see it.. Well YouTube Vanced anyway when going from video to the home screen.

    If you have a chance would you mind try downloading something from the Playstore and see if it is like my video with the download icon over to the left of the clock, please.
    Just for peace of mind. :)
    I did. Mine starts and stays to the right of the clock....
  • 10
    Here's a workaround on getting a smaller statusbar area if you have root. Flash the attached zip in magisk manager. Go to developer settings and choose waterfall cutout. I don't have this phone so I cannot give you screenshots.

    Android 12
    Uploaded 10-22-21

    Center clock

    Center clock 36 dip

    Left clock

    Left clock 36 dip

    Right clock

    Right clock 36 dip


    --------------------------

    Android 11
    Uploaded 10-6-21

    Center clock

    Center clock 36 dip

    Left clock

    Left clock 36 dip

    Right clock

    Right clock 36 dip


    Big thanks to @paperecho and @wgrant for the many tests they performed in order to get spacing to an acceptable level (though there will be differences due to any dpi edits)

    -------------------------------------------------
    If I helped, hit the Thanks Button!
    Feeling generous, send me a beer!
    --------------------------------------------------
    4
    The clocks should be on the same level as the other icons on these. These have not been tested.
    3
    Android 12 mods have been uploaded.
    3
    It appears not - I had to troubleshoot numerous boot loops until I identified this statusbar mod as the cause.
    @Tulsadiver - I know it's hard to keep updating these every month or so, but any chance you can get us a fresh batch for March 2021?
    In progress!
    2
    Anyone with p5 or p5g have the update and tried the system ui mods yet?
    I'm using the build from post #138 on my P5 with the feb patch. No issue whatsoever