Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,193 Members 36,568 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] Hide Status Bar and still being able to expand it on Jelly Bean

Tip us?
 
enryea123
Old
(Last edited by enryea123; 26th August 2013 at 10:33 AM.) Reason: title changed
#1  
enryea123's Avatar
Senior Member - OP
Thanks Meter 178
Posts: 160
Join Date: May 2011
Location: Milan
Default [GUIDE] Hide Status Bar and still being able to expand it on Jelly Bean

The purpose of this guide is to show you how to hide the status bar and still be able to swipe it down.
I've tested this guide on CYANOGENMOD10.1 with my galaxy nexus and everything works perfectly.
Tested and working on: cm10, cm10.1, paranoid android. Not tested but should work on: aokp and aosp roms.
On miui roms, it should be ok with some differences (watch here)
It should work also on other custom roms. I don't know if will work on htc,sony based roms (if you manage to make it working, please report).
If you are on a samsung based rom read the guide and also watch here

Some users reported that it works on ics too.
I don't know if this is going to work for tablets too (since they have the notification area and the buttons in the same bar).
I'm not a themer, i had to flash almost 50zips to make everything work.
what i mean is that if you will have problems, i might not be able to help you (especially with smali files).
If you are looking only for a transparent status bar watch HERE.

I made a short video to show you what this mod is about.


We will be using apktool, if you don't know how to use it, check HERE.
If you are having problems with apktool on ubuntu, THIS might help you.

How does it work:the status bar will still be there. it will be fully transparent, a bit smaller and it will not have anymore the reserved top space

it might look difficult, but you will only have to modify a few lines of code
--------------------------------------------------------------------------------------STEPS--------------------------------------------------------------------------------------
  • download your rom and extract SystemUI.apk and framework-res.apk
  • open the terminal/cmd (you will NEVER close it during the procedure) in the folder where you unpacked systemui and framework-res and type
    Code:
    apktool if framework-res.apk
    Code:
    apktool d framework-res.apk
    this will create a framework-res folder.
  • open framework-res/res/values/dimens.xml and replace the line
    Code:
    <dimen name="status_bar_height">25.0dip</dimen>
    with
    Code:
    <dimen name="status_bar_height">6.0dip</dimen>
    you can choose a value between 1dip and 10dip (i suggest 2 to 5 dip). I personally use 2dip. If you can't swipe it down after the flash try with 10dip.
    EDIT: if you want also a 0dip navbar modify the 3 lines below this one
    save the file and close it
  • type in the terminal/cmd
    Code:
    apktool d SystemUI.apk
    this will create a SystemUI folder
  • open SystemUI/res/values/drawables.xml and replace the line
    Code:
    <item type="drawable" name="status_bar_background">#ff000000</item>
    with
    Code:
    <item type="drawable" name="status_bar_background">#00000000</item>
    save and close
  • open SystemUI/res/layout/super_status_bar.xml and replace
    Code:
    <com.android.systemui.statusbar.phone.StatusBarWindowView android:background="@*android:color/transparent" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
    with
    Code:
    <com.android.systemui.statusbar.phone.StatusBarWindowView android:background="#00000000" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
    save and close
  • open SystemUI/res/layout/status_bar.xml and replace
    Code:
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
    with
    Code:
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="0.0dip" android:layout_height="0.0dip">
    then
    Code:
    <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
    with
    Code:
    <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginRight="4.0dip">
    and then
    Code:
    <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
    with
    Code:
    <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0">
    save and close
  • now open SystemUI/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
    and search for
    Code:
    invoke-direct/range {v0 .. v5}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
    you will have 3 matches, the correct line should be right after
    Code:
    const/16 v3, 0x7d0
    
    const v4, 0x800048
    
    const/4 v5, -0x3
    you have to replace
    Code:
    const/16 v3, 0x7d0
    with
    Code:
    const/16 v3, 0x7d1
    (with this change the status bar will not have anymore the reserved top space)
    save and close
  • now you can recompile framework-res and systemui typing in the terminal/cmd
    Code:
    apktool b framework-res framework-res.apk
    Code:
    apktool b SystemUI SystemUI.apk
  • make a flashable zip with this 2 files (if you have problems flashing or when you reboot nothing has changed, use my zip attached below).
--------------------------------------------------------------------------------------DONE--------------------------------------------------------------------------------------
to revert back just flash the stock systemui and framework-res of your rom

You will have only one "bug", you will not to able to expand the status bar in the lockscreen.
If you are a themer and you know how to fix this, you are welcome.
You will avoid this bug using a lockscreen app like widgetlocker.

I use this mod along with notifier pro, a very useful app.

thank you for reading my guide
Attached Files
File Type: zip flashable.zip - [Click for QR Code] (217.7 KB, 2401 views)
You know you are rooted when your girlfriend looks in your messages and gets suspicious cause you have none
The Following 72 Users Say Thank You to enryea123 For This Useful Post: [ Click to Expand ]
 
Shmi117
Old
#2  
Shmi117's Avatar
Senior Member
Thanks Meter 350
Posts: 631
Join Date: Aug 2012
Default Re: [GUIDE] Hide Status Bar and still being able to expand it on CM10.1

Really nice, I will use this when 10.1 comes to my device :P

By the way, you made an error in your first sentence. It should say status bar instead of navbar.

| Nexus 7 Gouper | CyanogenMod 10.2 | M-Kernel | Custom Build.prop | PmR/Custom Init.d |
The Following User Says Thank You to Shmi117 For This Useful Post: [ Click to Expand ]
 
enryea123
Old
(Last edited by enryea123; 2nd February 2013 at 02:32 PM.)
#3  
enryea123's Avatar
Senior Member - OP
Thanks Meter 178
Posts: 160
Join Date: May 2011
Location: Milan
thanks for the correction.
i checked and it works also on cm10.
i will update the title of the first post
You know you are rooted when your girlfriend looks in your messages and gets suspicious cause you have none
The Following User Says Thank You to enryea123 For This Useful Post: [ Click to Expand ]
 
jauger
Old
#4  
jauger's Avatar
Senior Member
Thanks Meter 36
Posts: 153
Join Date: Jun 2008
Location: Down South
Thanks for the guide, this helps me use the Sony Xperia launcher on CY10.1.............
Samsung Galaxy Note III - Samsung Galaxy Note 10.1
Got your Rom the way you like it? NANDROID
Wanna try flashing something nice & shiney? NANDROID
Mother-n-Law coming to visit? NANDROID!!
I would fight off a velociraptor to protect my Dropbox. http://db.tt/1V3r18L
 
halliba
Old
(Last edited by halliba; 2nd February 2013 at 08:31 PM.)
#5  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Feb 2013
Location: Hamburg
very good tutorial. easy to understand and easy to do
worked fine. My Statusbar disappeared... But I can't swipe it Down
Any idea?^^

edit: i'm using Cm 10.1-20120121-NIGHTLY-i9300 and Next launcher 3D
 
enryea123
Old
#6  
enryea123's Avatar
Senior Member - OP
Thanks Meter 178
Posts: 160
Join Date: May 2011
Location: Milan
Quote:
Originally Posted by halliba View Post
very good tutorial. easy to understand and easy to do
worked fine. My Statusbar disappeared... But I can't swipe it Down
Any idea?^^

edit: i'm using Cm 10.1-20120121-NIGHTLY-i9300 and Next launcher 3D
Uhm, maybe you should set an higher status_bar_height? Try with 10dip.
Or you can even leave it to 25dip and test it to see if the problem is the small swipable area
You know you are rooted when your girlfriend looks in your messages and gets suspicious cause you have none
 
halliba
Old
#7  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Feb 2013
Location: Hamburg
Quote:
Originally Posted by enryea123 View Post
Uhm, maybe you should set an higher status_bar_height? Try with 10dip.
Or you can even leave it to 25dip and test it to see if the problem is the small swipable area
works fine now. thanks
 
enryea123
Old
#8  
enryea123's Avatar
Senior Member - OP
Thanks Meter 178
Posts: 160
Join Date: May 2011
Location: Milan
You're welcome
You know you are rooted when your girlfriend looks in your messages and gets suspicious cause you have none
The Following User Says Thank You to enryea123 For This Useful Post: [ Click to Expand ]
 
lukakas
Old
#9  
Senior Member
Thanks Meter 385
Posts: 441
Join Date: Jun 2012
Location: São Paulo - SP
Why not add as an optional feature for cm10.1? It would be interesting to do it in full screen app slide down once for low to show the status bar and once again to open the notifications bar like this http://www.youtube.com/watch?v=ek-hq-lD1lw
 
Shponglized
Old
#10  
Shponglized's Avatar
Senior Member
Thanks Meter 203
Posts: 626
Join Date: Aug 2012
Location: Louisville
Does this make it to where you can only swipe from a small area? because I use a setting in CM 10.1 to swipe down on the quicksetting already when you pull down from the right corner. I love that.

Does Apktool even work on Windows 8, I'm wanting to do this, but not quite prepared.

Another thought, Is there any way to do this only on the home screen? That's the only place it really really bothers me.

Also, You Signature is priceless.

CURRENT
Phone Samsung Galaxy Nexus (Toro Plus)
Status Unlocked/Rooted/TWRP
ROM Paranoid Android 3+
RETIRED
Phone HTC Evo 3D (CDMA)
Status Unlocked/S-Off/4Ext
ROM CM 10.1 Goin' In

The Following User Says Thank You to Shponglized For This Useful Post: [ Click to Expand ]
Tags
hide status bar jb expand cyanogenmod
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes