Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP enryea123

1st February 2013, 05:56 PM   |  #1  
enryea123's Avatar
OP Senior Member
Flag Milan
Thanks Meter: 178
 
160 posts
Join Date:Joined: May 2011
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, 2613 views)
Last edited by enryea123; 26th August 2013 at 11:33 AM. Reason: title changed
The Following 72 Users Say Thank You to enryea123 For This Useful Post: [ View ]
1st February 2013, 06:28 PM   |  #2  
Shmi117's Avatar
Senior Member
Thanks Meter: 350
 
633 posts
Join Date:Joined: Aug 2012
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.
The Following User Says Thank You to Shmi117 For This Useful Post: [ View ]
1st February 2013, 06:38 PM   |  #3  
enryea123's Avatar
OP Senior Member
Flag Milan
Thanks Meter: 178
 
160 posts
Join Date:Joined: May 2011
thanks for the correction.
i checked and it works also on cm10.
i will update the title of the first post
Last edited by enryea123; 2nd February 2013 at 03:32 PM.
The Following User Says Thank You to enryea123 For This Useful Post: [ View ]
2nd February 2013, 08:25 PM   |  #4  
jauger's Avatar
Senior Member
Flag Memphis Tennessee
Thanks Meter: 61
 
212 posts
Join Date:Joined: Jun 2008
More
Thanks for the guide, this helps me use the Sony Xperia launcher on CY10.1.............
2nd February 2013, 09:26 PM   |  #5  
Junior Member
Flag Hamburg
Thanks Meter: 0
 
4 posts
Join Date:Joined: Feb 2013
More
Thumbs up
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
Last edited by halliba; 2nd February 2013 at 09:31 PM.
2nd February 2013, 09:35 PM   |  #6  
enryea123's Avatar
OP Senior Member
Flag Milan
Thanks Meter: 178
 
160 posts
Join Date:Joined: May 2011
Quote:
Originally Posted by halliba

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
2nd February 2013, 09:43 PM   |  #7  
Junior Member
Flag Hamburg
Thanks Meter: 0
 
4 posts
Join Date:Joined: Feb 2013
More
Quote:
Originally Posted by enryea123

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
2nd February 2013, 09:45 PM   |  #8  
enryea123's Avatar
OP Senior Member
Flag Milan
Thanks Meter: 178
 
160 posts
Join Date:Joined: May 2011
You're welcome
The Following User Says Thank You to enryea123 For This Useful Post: [ View ]
3rd February 2013, 12:08 AM   |  #9  
Senior Member
Flag São Paulo - SP
Thanks Meter: 391
 
441 posts
Join Date:Joined: Jun 2012
More
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
3rd February 2013, 01:08 AM   |  #10  
Shponglized's Avatar
Senior Member
Flag Louisville
Thanks Meter: 203
 
626 posts
Join Date:Joined: Aug 2012
More
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.

The Following User Says Thank You to Shponglized For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
hide status bar jb expand cyanogenmod
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes