[Xperia Z Themes and Apps] Ticklefish:
One of the great things about Sony's recent roms is the battery text they provide. You no longer have to mod your battery icon yourself to get an exact percentage of your battery level.

But that means you don't really need the battery icon at all anymore. So this is how you get rid of it. And this is how you get rid of it the Awesome Way!

So this is what my phone looks like without any modding:

To remove the battery icon, you need to decompile your SystemUI.apk with apktool. There are many ways of doing this, and many tools, and I'm not going to list them all. Personally I always use Tickle My Android but it's up to you what you use. Refer to your tools instructions and MAKE SURE YOU MAKE A BACKUP FIRST!

Once you've decompiled your SystemUI.apk, you need to edit res\layout\status_bar.xml. This looks like this:

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@color/system_ui_opaque_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
<com.sonymobile.systemui.statusbar.operator.OperatorLabel android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="marquee" android:gravity="start|center" android:id="@id/operator" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="6.0dip" android:paddingEnd="4.0dip" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="6.0dip">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconPartitioner android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</LinearLayout>
</com.android.systemui.statusbar.phone.IconPartitioner>
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<TextView android:layout_gravity="start|center" android:id="@id/battery_text" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" android:paddingStart="4.0dip" style="@style/SystemBarNotificationText" />
<ImageView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="4.0dip" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="6.0dip" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginEnd="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingEnd="10.0dip">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:textAlignment="viewStart" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:textAlignment="viewStart" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

If you're new to Android xml, this can look a little overwhelming. But don't worry, we only need to deal with one line:

<ImageView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="4.0dip" />

This is the code that controls the battery icon. It's tempting to think that this line could just be deleted but that can actually cause problems. Instead we'll to add a certain parameter to make Android ignore this line completely.

<ImageView [COLOR="Red"]android:visibility="gone"[/COLOR] android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="4.0dip" />

Save, compile, etc and you'll end up with something that looks this:

So this works. But...is it AWESOME?

Not yet. It all looks a little..odd. The battery text is smaller than the clock. So let's sort that out next. This is the battery text code:

<TextView android:layout_gravity="start|center" android:id="@id/battery_text" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" android:paddingStart="4.0dip" style="@style/SystemBarNotificationText" />

Remove the style parameter from near the end of the code and replace it with the textAppearance from the clock code:

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="6.0dip" />

Which gives us:

<TextView android:layout_gravity="start|center" android:id="@id/battery_text" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" android:paddingStart="4.0dip" android:textAppearance="@style/TextAppearance.StatusBar.Clock" />

And that, once you've saved, recompiled and everything else, looks like this:

So...is this AWESOME? No, not yet. This is just COOL. Read the next post to find out how to remove the battery icon in an even better way. In a way that's...can you guess...AWESOME!! :cool: