[Android Themes] TheGrammarFreak:
About

A while ago Taine0 posted this thread. He's since vanished from XDA, and I have, at the request of several users, posted this here so that we have an active member in control of the first post. My goal is to write an in-depth guide into how to perform this modification, as well as a few other tidbits that could be of use. I also intend to maintain a list of links to other good guides, as written by other people. That is in the second post. I may well add a few, shorter, guides to some other popular tweaks to the third post if people want

Credits

Taine0 made this first, to the best of my knowledge. I can't stress enough how this thread is just to give coherent support.

ZduneX25: worked out how to stop new notifications from overlapping the clock, as well as re-order the status icons

Randomchars: worked out how to stop new notifications from overlapping the clock, as well as re-order the status icons

If there are others who I've forgotten about, please tell me! It's been a long time since I saw those posts

Contents

Post one:

-> Set up

-> Centring the clock

-> Switching the notification icons with the status icons

Post 2:

-> Other people's guides

Post 3:

-> Power control widget at the bottom of the notification shade (we need a short name for that mod ;))

-> Re-ordering the status icons

-> Removing power menu blur

A word of warning

If any of you quote this entire post, EVER, I will not help you. At all. I'll even go so far as to try and get a moderator to edit your post. This is a HUGE post, the last thing we need is multiple copies of this post littered throughout the thread. Quote only the bit you're struggling with.

The guide

This guide is written to be as cross compatible as possible. It's worth noting that my operating system of choice is Ubuntu, so thinks like apkmanager don't work too well for me.

Tools used

APKTool

A text editor. In my case it's gedit. On windows I suggest you use Notepad++. Mac users: the default text editor should work fine, but I've not tested it. I rarely, if ever, use macs.

An archiving tool. On Ubuntu the built in archive manager works perfectly. For windows users I'd suggest you get 7Zip, but winrar works too.

ADB. To set it up on Linux see here. If you're using windows see the next section for a quick guide. Mac users: for reasons mentioned above, you're on your own here. Sorry :(

ADB on windows

Download and extract this to a known location, such as C:\ADB. Now you need to add that to your PATH. See here for info on that. I believe you can also download the Android SDK and it has an automated installer for Windows now, but I'm not 100% sure on that.

Preparation

Set up ADB and APKTool. A guide for setting up APKTool can be found here

Now that you have ADB set up you can plug your phone into your computer, ensuring that you have "USB debugging enabled" (Settings --> Applications --> Development --> USB Debugging on 2.3 || Settings --> Developer options -->USB Debugging on 4.0)

Open up a terminal (CMD on Windows) by doing the following:

Linux: CTRL+ALT+T

Windows: Windows key+R, then type "CMD" (without quotes) and hit ENTER

Mac: No idea. If someone tells me I'll put it here

Now enter the following command to verify that your device is detected:

adb devices

The output should be something like this:

sam@Coruscant:~$ adb devices
List of devices attached
3735698AA76400EC device

Yes, my name is Sam. Yes I named my PC Coruscant. Deal with it ;)

Now, change directory to a useful working directory. For example:

cd ~/Android/Legend/StatusBarMod/Working/

On Windows you can just navigate to your chosen directory in Windows Explorer (the file manager) then hold SHIFT while right clicking, and choose "Open CMD here" (or something like that, I forget. Please confirm)

Next you need to pull SystemUI.apk and framework-res.apk from the device:

adb pull /system/app/SystemUI.apk
adb pull /system/framework/framework-res.apk

Output looks like this:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ adb pull /system/app/SystemUI.apk
3592 KB/s (1423910 bytes in 0.387s)
sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ adb pull /system/framework/framework-res.apk
4649 KB/s (9245621 bytes in 1.941s)

Now you need to set up APKTool to use your framework-res.apk:

apktool if framework-res.apk

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ apktool if framework-res.apk
I: Framework installed to: /home/sam/apktool/framework/1.apk

Now you need to decompile SystemUI.apk:

apktool d SystemUI.apk

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ apktool d SystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: /home/sam/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

It might also be an idea to decompile framework-res.apk if you want to change the order of the status icons (signal, wifi etc.):

apktool d framework-res.apk

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ apktool d framework-res.apk
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

Open a file manager and navigate to you working directory. You'll see something like this:

Navigate to SystemUI/res/layout

If your ROM is CM, or CM based, you'll see this:

If your ROM is different, don't worry. The only file we're using here is status_bar.xml.

Open status_bar.xml in your text editor (gedit for me, notepad++ for most of you) and try to get familiar with the XML layout. I can't go into all the ins and outs here, but "<" starts a line, and ">" finishes a line. Regardless of whether your text editor wraps the text, that's how it works. A line is NOT finished until you see this: ">". If possible, set your text editor up to NOT wrap text around. You'll end up scrolling left and right a lot, but it's much easier to track what you're doing this way. :)

Centring the clock

Open a new tab in your text editor (yes, you can do that) 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 centre of the status bar, but it currently doesn't hold the clock element in it. Go back to your status_bar.xml and look for a line that starts like this:

<com.android.systemui.statusbar.Clock

Remember, that clock line doesn't finish until you find the closing ">". Copy that entire line, then delete it (or just cut it, if you're feeling swish), 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]android:gravity="center"[/COLOR] android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

</LinearLayout>

See the bit that's highlighted in red? It's highlighted because I've changed "right" to "center". You need to do that too. Copy that whole block of code and paste it just below the line that ends like this:

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

So that you end up with something like this:

<com.android.systemui.statusbar.CmStatusBarView android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
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: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 a few things, like centring the date (to make it look nice) and making it so the date and new notifications don't overlap the clock.

To centre the date:

Find the line that starts like this:

<com.android.systemui.statusbar.DateView

and scroll across that line until you see this:

android:gravity="left|center"

Change that bit to this:

android:gravity="center"

Then scroll across a little more and change this:

android:layout_width="wrap_content"

to this:

android:layout_width="fill_parent"

.

That's the date centred!

To fix the notification overlap you need to add a little to this line:

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

Scroll right to the end of that line and add this

android:background="@drawable/statusbar_background"

The whole line will look something 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 centred, no overlap!

Switching the icons around with the notification icons (optional)

It's worth noting that there will be a gap to the right of the notification icons. There's very little we can do that I'm afraid.

First you need to find the line that starts like this:

<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons"

and move it to just above this:

<com.android.systemui.statusbar.IconMerger

Now scroll to the end of the line that starts like this

<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons"

and change this:

android:layout_alignParentRight="true"

to this

android:layout_alignParentLeft="true"

Then on the line that starts like this:

<com.android.systemui.statusbar.IconMerger

change this

android:layout_alignParentLeft="true"

to this

android:layout_alignParentRight="true"

Now you can save and exit, because we're done there.

Recompiling SystemUI.apk

Go back to your terminal/cmd and enter the following command:

apktool b SystemUI

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

Now go back to your file manager and go up a few levels, until you end up back in your working directory. Open, but don't extract, SystemUI.apk and navigate to res/layout. Put the window to one side and go back to your file manager, then navigate to SystemUI/build/apk/res/layout. You'll see those same XML files, only this time they're binary XML, because they've been compiled.

Simply drag status_bar.xml from the file manager to the archive manager, and it will be copied across. No need to sign or anything. :D

Go back to CMD, and issue the following command to get rw access on /system:

adb remount

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ adb remount
remount succeeded

Then issue the following command to push your modified SystemUI.apk to your device:

adb push SystemUI.apk /system/app/SystemUI.apk

Output:

sam@Coruscant:~/Android/Legend/StatusBarMod/Working$ adb push SystemUI.apk /system/app/SystemUI.apk
3943 KB/s (1423910 bytes in 0.352s)

Then reboot and enjoy:

adb reboot

Video

[YOUTUBE]AJG94jJuCek[/YOUTUBE]

I'll make one that mirrors this guide more accurately over the coming weeks

Further reading

To be completed