New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
spc_hicks09
Old
(Last edited by spc_hicks09; 6th December 2011 at 09:46 AM.)
#1  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
Default [MOD] Statusbar MOD

Greetings all! Attention devs, themers and whoever else wants to do this lol. This is going to be a long post but I am putting this out there for whoever wants to use it. I cannot take full credit for this as there are quite a few posts that explain how to do this. I just went a lot more in depth and explained things so that even someone who has never done anything like this, can do it too.

This is going to be a tutorial of sorts on modding the statusbar so that you have the following:

Centered Clock
Statusbar Icons on the left
Centered Date

First, let me start by saying that I am in no way an expert on this and if this doesn't work for you, I might not be able to answer too many questions about it.

That being said, let's get started. First, you are going to need some stuff.

apkmanager: http://forum.xda-developers.com/showthread.php?t=695701

Notepad++: http://notepad-plus-plus.org/download/v5.9.6.2.html

The SystemUI.apk from your phone.

Now what you need to do is take that zip file for apkmanager that you downloaded and extract it somewhere that's easy to get to, like your desktop.

Inside the apkmanager folder on your desktop you should have 6 folders and 2 files. It should look like this:



NOTE: Do not change the names of any of these files or folders or the process will not work!

What you want to do next is take the SystemUI.apk that you pulled from your phone, either with Root Explorer or via ADB. And put your SystemUI.apk in the folder named "place apk here for modding."

Now double click the "Script" file to run it. A command prompt window will open up that looks like this:



Press "22" and hit the enter key to select your "project." Now press "1" and hit enter to select your SystemUI.apk as your current "project." Now you want to press "9" and hit enter to decompile the apk.

*NOTE: If you are trying to use a heavily themed SystemUI, this process might not work for you and you may have to find a stock SystemUI.apk and use it instead.

Now that the SystemUI is decompiled, go into the "projects" folder and you should see a SystemUI folder now. Open that up, then open the "res" folder and finally open the "layout" folder.

You should now be looking at a bunch of XML files. The one we're going to be editing is named "status_bar." That's the only XML file you're going to need to edit. Right click on that file and select either "Edit with Notepad++" or "Open with Notepad++," either one.

Now you should be looking at something similar to this:



Now comes the fun part!!

Centering the clock:

Open a new tab in your xml editor and paste this into it:

Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">


</LinearLayout>
That's the section that puts the clock in the center of the statusbar. But there's currently no clock element in it yet. Go back to your status_bar.xml and look for the line that starts like this:

Code:
<com.android.systemui.statusbar.Clock
Remember, that clock line doesn't finish until you find the closing ">". Highlight and copy that entire line, then delete it, then go back to your new tab and paste it into the middle of the code snippet above. It should look something like this:

Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">

<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

</LinearLayout>
See the part in the string above that is red? I've highlighted it to show you that you have to change this part of the string from "left|center" to "center."

Now copy that entire string of code above and paste it just BELOW the line that looks like this:

Code:
xmlns:android="http://schemas.android.com/apk/res/android">
This is what you should end up with:

Code:
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
           <com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textColor="#ffffffff" android:gravity="center" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>
Now we need to fix some stuff, like making the date centered and making it so that the date and the notifications don't overlap the clock.

To center the date, find the string of code that starts like this:

Code:
<com.android.systemui.statusbar.DateView
And scroll right, across that line until you see this:

Code:
android:gravity="left|center"
Change that part to this:

Code:
android:gravity="center"
Now scroll across that same line a little more, until you find this part:

Code:
android:layout_width="wrap_content"
Change it to this:

Code:
android:layout_width="fill_parent"
Congratulations your date is now centered!!

Now to fix the notification overlap, you need to find the line that starts like this:

Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker"
Scroll all the way to end of that line and add this to the end:

Code:
android:background="@drawable/statusbar_background">
That entire line should now look like this:

Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/statusbar_background">
Clock centered, no overlap!!

Setting the icons to the left hand side of the statusbar: (optional)

First, find the line that starts like this:

Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons"
Copy that entire line, then delete it and paste it above the line that starts like this:

Code:
<com.android.systemui.statusbar.IconMerger
In that same line, change this part:

Code:
android:layout_alignParentRight="true"
To this:

Code:
android:layout_alignParentLeft="true"
Now find the line that starts like this:

Code:
<com.android.systemui.statusbar.IconMerger
And change this part:

Code:
android:layout_alignParentLeft="true"
To this:

Code:
android:layout_alignParentRight="true"
Guess what? That's it, you're finally done lol! Now let's recompile the SystemUI.apk.

Before you close out of Notepad++, check your edited XML and make sure there are NO GAPS between the lines. What I mean is this, this is kind of what your xml should look like all the way through it:

dfsdfsdfsdfsdfsd
sdfsdfsdf
sdfsdfsdfsdsdfsdfsdfsdf
fsdfsdfsdfs

See, no gaps. It should NOT look like this:

asdasdasdasd

asdasdasdasd
asdasdasd

asdasdasdasd

See what I'm saying?

Close out of Notepad++ and make sure you save all the changes. If you don't, you're back at square one and will have to do everything again lol. You don't want that.

Go back to that command prompt window that opened up for apkmanager. If you closed it, that's fine, just double click the "Script" file again to open it back up.

Press "22" and hit enter to select your "project" again. Press "1" then hit enter to select the SystemUI.apk.

Press "11" to Compile the apk and cross your fingers that you didn't mess anything up. If you did, you will get an error upon compiling the apk and will have to start over again. If you don't get an error, you should get a message that says this:

Code:
Is this a system apk <y/n>
Press "y" and hit enter.

Then you should get:

Code:
Aside from signatures, would you like to copy over any additional files that you did not modify from the original apk in order to ensure least number of errors <y/n>
Press "y" and hit enter.

Next you should get this:



Do as it says and go into the "keep" folder that you now see with all the other folders (place apk here for blah blah blah).

Delete this file:

resources.arsc

And the "status_bar.xml", now go back to the command prompt and hit enter.

Let it run it's course and you should be good to go!!! Now look in the "place apk here for modding" folder and you should see a "unsignedSystemUI.apk"

Yes the file size will be a little different. That's ok!!!

Rename the file to "SystemUI" and either use adb to push it to your phone or place the apk on your sdcard and use Root Explorer to copy/paste it into /system/app

If you use Root Explorer, maybe even if you use adb. You will probably get some force closes after you push or paste the app. Your phone might even freeze up, mine did. That's ok too!!!! Pull the battery and restart your phone.

Now when you first boot up, you might not have a statusbar anymore. That's ok too lol. Using Root Explorer, navigate to /system/app and "mount as R/W." Now find the SystemUI.apk. Press and hold on it and select "Permissions." Change the permissions to look like this:



Exit out of Root Explorer and reboot. That's it, you're completely done! As soon as I can perfect it a little better, I will also post a walkthrough on switching around the order of the statusbar icons as well! Final results should look something similar to this:



Enjoy!!!! If you like this post and think it contributes, please press the "Thanks" button.


If you are having troubles with the process, take a look at my status_bar.xml and compare it to yours.

status_bar.xml download:
http://www.multiupload.com/7MXI3ME1QR


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com
The Following 12 Users Say Thank You to spc_hicks09 For This Useful Post: [ Click to Expand ]
 
spc_hicks09
Old
#2  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
Reserved for more stuff !


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com
 
owen.d
Old
#3  
owen.d's Avatar
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Dec 2011
Thanks to share, available for download ah
 
spc_hicks09
Old
#4  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
Quote:
Originally Posted by owen.d View Post
Thanks to share, available for download ah
Not sure I understand what you're asking.


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com
 
ChaoticWeaponry
Old
#5  
ChaoticWeaponry's Avatar
Senior Member
Thanks Meter 188
Posts: 518
Join Date: Oct 2011
Quote:
Originally Posted by spc_hicks09 View Post
Not sure I understand what you're asking.
Im gonna guess he thinks theres a download for the whole process like V6 Supercharger. Just a guess.
Retired Devices
-Samsung Alias
-LG EnV Touch
-Motorola Droid 3 (XT862) -Still using occasionally-

Current Devices
--Samsung Galaxy Note 2 - Running CleanROM, Overclocked to 1.8gHz CPU, 800mHz GPU

--ASUS Eee Pad Transformer B80 (TF101) - Rooted, Running CM10, Overclocked to 1.704gHz
 
spc_hicks09
Old
#6  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
Quote:
Originally Posted by ChaoticWeaponry View Post
Im gonna guess he thinks theres a download for the whole process like V6 Supercharger. Just a guess.
Ah ok, gotchya.


Quote:
Originally Posted by owen.d View Post
Thanks to share, available for download ah
This isn't a mod that you can download. You have to do all this by yourself.


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com
 
spc_hicks09
Old
#8  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
Quote:
Originally Posted by somemadcaaant View Post
Oh thats nice I'll be trying this when I get home.

Good work.

-smc
Thanks!

Sent from my DROID3 using Tapatalk


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com
 
spc_hicks09
Old
#9  
spc_hicks09's Avatar
Senior Member - OP
Thanks Meter 1259
Posts: 3,049
Join Date: Jan 2011
Location: Hawaii

 
DONATE TO ME
OP has been updated!!! If you're having troubles, look at the bottom of Post #1 and find the download link for a copy of my status_bar.xml. You can download this and compare it to your status_bar.xml


Current Device: RAZR HD XT926
RAZR HD Developer / Themer
Galaxy Nexus Developer / Themer
Droid RAZR Developer / Themer
Droid RAZR M Developer
Samsung Galaxy SIII Developer

Website: www.droidrzr.com


XDA PORTAL POSTS

Expand Your Choice of Icons with Icon Themer

Icons are some of the most commonly themed elements of the Android UI, and there is certainly no … more

MicrowaveTimePicker Brings 4.2 TimePicker to 2.1+ Devices

It’s frustrating to see slick new features that you can’t use when … more

What’s Possible with CASUAL & How to Make Your Own CASUAL – XDA Developer TV

XDA Elite Recognized Developer AdamOutler is known … more

Pearl Chen to Talk NFC Development at XDA:DevCon 2013

From HTML to LEDs or Android to Arduino, Hardware Hacking is a pastime of many people … more