[Defy Themes and Apps] [] AL []:
OK, here's some use for this reserved spot...

[I mainly wrote this up for myself as a reminder only, but why not share it with you guys right!?!]

How to fix the date overlapping issue in statusbar.

Credits go to Achep

for his JB-style notification panel time/date layout – a big THANK YOU.

His index thread here

Let’s start!

MAKE A NANDROID BACKUP

MAKE A NANDROID BACKUP

MAKE A NANDROID BACKUP

…or at least make an UNDO flashable zip with the original SystemUI.apk in case that you lose the statusbar in the process and are unable to switch the memory card access from it. You could then also access it through the recovery usb sharing option, but the zip is easier…

Tools needed:

- Prior knowledge on decompiling/compiling apks.

- 7-zip

- Notepad++

- Paint.NET

- Apktool or other decompiling/compiling tool

[sorry I have no link for all those at this time – maybe later]

Notes:

- I put some extra details here and there might be errors – thanks for signaling them to me; I’ll do my best to update/correct stuff up as needed;

- I will not answer questions on how to compile/decompile if you do not do your part first and learn about all that stuff. So read about Java and Android development kits, see environment path variables for java… Signing apks or not (for system apps)…

Let’s start for real this time…:

Pull these two files from the nightly zip : framework-res.apk [in \system\framework] and SystemUI.apk [in \system\app] and place them in your apktool folder [c:\apktool in this guide].

Decompiling SystemUI.apk:

Run: cmd

Load apktool folder:

cd c:\apktool

Load the framework:

apktool if framework-res.apk

Decompile SystemUI.apk:

apktool d SystemUI.apk

You can leave this command prompt window open (or minimize it to tray) as we’ll need it to recompile in not too long…

Enabling transparent statusbar:

Go to C:\apktool\SystemUI\smali\com\android\systemui\statusbar\ folder.

Open StatusBarService.smali with Notepad++ and look for [Search/Find…]:

invoke-direct/range {v0 .. v5}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V

[this should be around line 2220]

And change the line just above it from:

const/4 v5, 0x2

to:

const/4 v5, -0x3

Save the file and exit.

Note:

As is, that part will allow transparent statusbar for themes made for it.

If you do not want to use a custom transparent-enabled theme, you will then have to modify these 2 files in C:\apktool\SystemUI.apk\res\drawable-hdpi\:

statusbar_background.9.png

status_bar_background.9.png

and set their layer transparency level [with Gimp, Photoshop, Paint.NET or whatever] to whatever you like. But be careful: they are .9 files so you should not make the surrounding one pixel border transparent at all. Learn more about handling .9.png files before venturing into this [might write up something about this at another time].

Optionally, you can also modify these 2 files (which are for the notification panel pulldown background and the handle at the bottom):

shade_bg.png

status_bar_close_on.9.png

More info on all this can be found here on post #2 of one of my previous thread.

Otherwise, you can use my WizAL theme from the OP and it will save you the trouble.

Removing the date (and its background) from the pulled down statusbar:

Navigate to and open up: C:\apktooll\SystemUI\res\layout\status_bar.xml

Find [~ 3rd line from the bottom]:

<com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="left|center" android:id="@id/date" android:background="@drawable/statusbar_background" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

Change it to:

<com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="left|center" android:id="@id/date" android:textColor="@android:color/transparent" android:background="@android:color/transparent" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

Save the file.

Adding AChep’s JB-style Date layout in the pulldown notification panel:

Download the attached zip and extract the 2 smali files from AChep [StatusBarJellyHeaderView.smali and StatusBarJellyHeaderView$1.smali ] and paste them into this folder:

C:\apktool_al\SystemUI\smali\com\android\systemui\statusbar\

Now go to C:\apktool\SystemUI\res\layout\status_bar_expanded.xml and look for:

<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/carrier_label_layout" android:layout_width="fill_parent" android:layout_height="wrap_content">

[around or at line 6]

And paste this code just below:

<com.android.systemui.statusbar.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingRight="37.0dip" />

This previous step is not perfect as I just use some padding between the new date/time layout and the clear button. So that button will move left and right slightly depending on how much space the time takes. I still need to learn how to use RelativeLayouts…so if anyone knows, please share your knowledge.

Now with this mod, there is no room for the carrier label on there; so let’s remove it completely by removing the line directly below the one you’ve just added – so delete this line:

<com.android.systemui.statusbar.CarrierLabel android:textAppearance="?android:textAppearanceLarge" android:textColor="@color/carrier_label_text_color" android:layout_gravity="center_vertical" android:paddingLeft="4.0dip" android:paddingBottom="1.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />

Save file and exit.

We’re now ready to recompile the SystemUI.apk:

apktool b SystemUI

Go to your desktop and place an untouched copy of your SystemUI.apk file on there [you can copy the one you’ve previously placed in c:\apktool folder if needed].

Right-click on it and select: 7-zip / Open archive.

Now in your C:\apktool\SystemUI\ working folder you will see: a new “build” folder --> open it up and then also open up the “apk” sub-folder.

From it, select these three things: the complete “res” folder, the “classes.dex” file and the “resources.arsc” file and replace the originals by drag-and-dropping them onto your desktop [untouched] opened archive. [answer yes to the file copy popup]. Close the archive and and you’re basically done!!

Just remember that this file is now your modded SystemUI.apk so you can push it to \system\app folder on your phone [do not rename it] through adb or [my preferred method] through the use of CWM recovery flashable zip.

References:

- Go read THIS if you want to learn how to make a CWM recovery flashable zips.

Final Notes:

- I do not recommend to push the resulting file manually [read with RootExplorer or other file managers] because you might make the statusbar disappear or worst case, get into an error loop before you get the chance to set the file’s permissions. So you’ve been warned: use adb or an update zip to push the modded file.

- for this to tweak to display properly, you will have to make sure that you do not choose the “Compact carrier label” option in CyanogenMod settings / Interface / Status bar tweaks.

- Again, play it safe and prepare yourself an undo patch with the original SystemUI.apk.

THE ATTACHED FLASHABLE ZIP IS TO BE APPLIED TO MANIAC103'S 2012NOV07 (Defy or Defy+) BUILDS ONLY

[although maniac's OCT25th (plus/no plus) builds have he exact same SystemUI.apk also...]

AGAIN: the SystemUI.apk

changes from build to build and using this zip on another build might break things up

;

==> this is why this guide exists:so redo the mod/zip for future (or older) nightly builds.

Cheers

/A