[Motorola Droid 3] spc_hicks09:
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://xdaforums.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:

<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:

<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:

<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" [COLOR="Red"][B]android:gravity="center"[/B][/COLOR] 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:

xmlns:android="http://schemas.android.com/apk/res/android">

This is what you should end up with:

<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:

<com.android.systemui.statusbar.DateView

And scroll right, across that line until you see this:

android:gravity="left|center"

Change that part to this:

android:gravity="center"

Now scroll across that same line a little more, until you find this part:

android:layout_width="wrap_content"

Change it to this:

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:

<LinearLayout android:orientation="horizontal" android:id="@id/ticker"

Scroll all the way to end of that line and add this to the end:

android:background="@drawable/statusbar_background">

That entire line should now look like this:

<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:

<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:

<com.android.systemui.statusbar.IconMerger

In that same line, change this part:

android:layout_alignParentRight="true"

To this:

android:layout_alignParentLeft="true"

Now find the line that starts like this:

<com.android.systemui.statusbar.IconMerger

And change this part:

android:layout_alignParentLeft="true"

To this:

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:

Is this a system apk <y/n>

Press "y" and hit enter.

Then you should get:

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