[Status bar/notification mod] Center clock and icon switch - CM7/gingerbread - update

Search This thread

Taine0

Senior Member
Nov 22, 2010
270
664
statustesst.png
pulldownbar.png



As you can see, I've managed to center the clock and switch the notification and system icons around.
So I've only tested this mod on CM7 and HDPI.
I can't see why it wouldn't work on other gingerbread roms, pretty certain all gingerbread have the same type of statusbar.xml to play around with.

Things you need -
APKmanager
Notepad++
rootexplorer

How to do it: Use rootexplorer to grab your systemui located system>app.
Decompile it with APKmanager, go into the layout folder and edit the statusbar.xml.


For those who want to just edit the clock here is the code to do it.
find the
<com.android.systemui.statusbar.Clock' delete that whole line and paste this above the linear layout
(edit:I updated the clock code to help centering, it'll now be centered for any screensize.)
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:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center"  android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
    </LinearLayout>

If you want the whole mod, heres a copy of my XML

Code:
<?xml version="1.0" encoding="UTF-8"?>
<com.android.systemui.statusbar.StatusBarView 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">
    <com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center" android:paddingLeft="145.0dip" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
    <LinearLayout android:gravity="left" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingLeft="5.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
    <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.IconMerger android:gravity="right" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="40.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
    </LinearLayout>
    <com.android.systemui.statusbar.CmBatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:gravity="center" android:orientation="horizontal" android:paddingLeft="297.0dip" android:paddingTop="2.5px" android:layout_width="wrap_content" android:layout_height="fill_parent" />
    <com.android.systemui.statusbar.CmBatteryMiniIcon android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/CmBatteryMiniIcon" android:layout_width="0.0px" android:layout_height="0.0px" />
    <ImageButton android:id="@id/status_home" android:background="@drawable/ic_statusbar_home" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
    <ImageButton android:id="@id/status_menu" android:background="@drawable/ic_statusbar_menu" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
    <ImageButton android:id="@id/status_back" android:background="@drawable/ic_statusbar_back" android:paddingRight="6.0dip" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
    <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:background="@drawable/statusbar_background" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="8.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.TickerView android:id="@id/tickerText" android:paddingTop="5.0px" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:textSize="12.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:paddingTop="4.0px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:textSize="12.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:paddingTop="4.0px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.TickerView>
    </LinearLayout>
    <com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textColor="#ffffffff" 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" />
</com.android.systemui.statusbar.StatusBarView>

You will need to change things to fit your own statusbar.xml. I'm on a old nightly for CM7 so it won't have as many things. So you'll have to play around and see what fits.

Once you edited, save the xml, compile with APKmanager, press Y to both questions, then deleted the resources file and statusbar.xml in the KEEP folder, sign it and then make a flashable zip and flash it over. Or replace the systemui with rootexplorer.

-----

Bugs to far: I can't seem to get the notification icons go all the way to the right side, It's not so bad because i've got the battery in place and the gap from the edge fits the battery perfectly, but it's annoying if you don't have the battery % on. I'm sure it's possible to alter it, I'm just not so great with XML.

Also the notifications overlap the clock when they get to the middle, I know how to fix that one, but just to lazy to bother as I never have that many notifications going on. The width of the notification display just needs changing.

Play around with it. Let me know how it goes.

-------
Notification mod now

Right, I've now themed the pulldown menu, I'm currently using images from the MEIZU theme as I was testing it out.

This is done by editting the status_bar_expanded.xml, replace lines that match yours.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<com.android.systemui.statusbar.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:orientation="vertical" android:background="@drawable/title_bar_portrait" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="0.0px">
             <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <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.5dip" android:layout_height="0.0px" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />
           </LinearLayout>
    </LinearLayout>
    <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
        <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
            <com.android.systemui.statusbar.NotificationLinearLayout android:orientation="vertical" android:id="@id/notificationLinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/noNotificationsTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/ongoingTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_ongoing_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/ongoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/latestTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_latest_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            </com.android.systemui.statusbar.NotificationLinearLayout>
   		</ScrollView>
    <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
 </FrameLayout>
  <LinearLayout android:orientation="vertical" android:background="@drawable/title_bar_portrait" android:layout_width="fill_parent" android:layout_height="35.0px">
     <TextView android:gravity="center" android:textSize="14.0sp" android:textStyle="bold" android:textColor="#a6a6a6"  android:id="@id/clear_all_button" android:paddingTop="3.0dip"  android:layout_width="480.0px" android:layout_height="fill_parent" android:scaleType="fitXY" android:text="@string/status_bar_clear_all_button" style="\?android:attr/buttonStyle" />
  </LinearLayout>
  <com.android.systemui.statusbar.powerwidget.PowerWidget  android:id="@id/exp_power_stat"  android:background="@drawable/title_bar_portrait" android:layout_width="fill_parent" android:layout_height="wrap_content" />  
 </com.android.systemui.statusbar.ExpandedView>
 
Last edited:

Che123

Senior Member
Aug 18, 2009
613
10
nice work - but you got many smilies in your code :D
may you should use the code-tags ;)

Wouldn't it be possible to add this into a theme chooser apk ?
 

dthomasen

Senior Member
Dec 8, 2007
441
103
Aarhus
www.dthomasen.dk
just tried this.. and my statusbar disapeared :D
Will continue to work on it.

Hmm weird.. Just tried to push the old SystemUI.apk to the phone (The original).. Rebooted, and the status bar is still gone :-?

EDIT: Nope, it's here again :D

EDIT 2: Just tried decompiling the APK, and compiling it again without making any changes. Then pushing it to the device and rebooting. My statusbar is still disapearing.

Am I doing something wrong? :( (Using apktool instead of APKmanager, 'cause im on a mac)
 
Last edited:

Taine0

Senior Member
Nov 22, 2010
270
664
nice work - but you got many smilies in your code :D
may you should use the code-tags ;)

Wouldn't it be possible to add this into a theme chooser apk ?

There, added codetags ;)

and I don't think so. I don't think the theme chooser has the same statusbar.xml. I haven't really looked tbh, though.

just tried this.. and my statusbar disapeared :D
Will continue to work on it.

Hmm weird.. Just tried to push the old SystemUI.apk to the phone (The original).. Rebooted, and the status bar is still gone :-?

EDIT: Nope, it's here again :D

EDIT 2: Just tried decompiling the APK, and compiling it again without making any changes. Then pushing it to the device and rebooting. My statusbar is still disapearing.

Am I doing something wrong? :( (Using apktool instead of APKmanager, 'cause im on a mac)

Hmm, are you signing the APK? I've only done it on aPKmanager, so not sure! also only done it with flashing the APK via recovery, too. I know in APKmanager you need to choose the systemapp options, does apktool have that? never used it, so not sure.
 

dthomasen

Senior Member
Dec 8, 2007
441
103
Aarhus
www.dthomasen.dk
Hmm, are you signing the APK? I've only done it on aPKmanager, so not sure! also only done it with flashing the APK via recovery, too. I know in APKmanager you need to choose the systemapp options, does apktool have that? never used it, so not sure.

Nope, not signing the apk. Maybe I should try that.

APKtool doesn't have systemapp options. It's pretty basic, it's only possible to compile/decompile without very many options.
 

SwiftLegend

Senior Member
Apr 1, 2010
811
88
Could this be made into a flash zip? I can never get these things to work right and would feel safer using a zip

Sent from my DROID X2 using XDA App
 

Taine0

Senior Member
Nov 22, 2010
270
664
Hmm.. signed the APK using test-keys.. Same result.. :confused:
You don't happen to know a way to create a flashable .zip without apkmanager?

I used uotkitchen for my flashable zip. I got it when I used it for the transparent status bar patch, Just upload your systemui.apk

Could this be made into a flash zip? I can never get these things to work right and would feel safer using a zip

Sent from my DROID X2 using XDA App

I can't make it a flashable zip because every rom uses a different setup in the statusbar.xml. So it'll just result in crashing your statusbar.
 
Last edited:

Taine0

Senior Member
Nov 22, 2010
270
664
but it should be compatible with the same rom?
Would you mind to share your CM7 systemui.apk?

Nope, it's even worse for CM7, every nightly seems different from what I've seen. My version is from nightly 24, so any version of CM7 after that will have a different systemui.apk.
 

dthomasen

Senior Member
Dec 8, 2007
441
103
Aarhus
www.dthomasen.dk
got it working :D

decompiling the APK, edit the statusbar.xml file, compiling again, putting it into an empty CWM3 edify zip file, and flashing!

Now my clock is on the right , and everything else on the left.. Next step, to get the clock centered :D
 

dthomasen

Senior Member
Dec 8, 2007
441
103
Aarhus
www.dthomasen.dk
hmm. I've edited the line you're telling us to, but I'm getting different result :)

screenshot1311003520372.png


Here's my status_bar.xml file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<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:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="6.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true" />
        <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" />
        <com.android.systemui.statusbar.CmBatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
        <com.android.systemui.statusbar.CmBatteryMiniIcon android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/CmBatteryMiniIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center" android:paddingLeft="145.0dip" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />      
        <LinearLayout android:orientation="horizontal" android:id="@id/buttons" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <ImageButton android:id="@id/status_edge_left" android:background="@drawable/ic_statusbar_edge_right_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_home" android:background="@drawable/ic_statusbar_home_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep1" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_menu" android:background="@drawable/ic_statusbar_menu_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep2" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_back" android:background="@drawable/ic_statusbar_back_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep3" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_search" android:background="@drawable/ic_statusbar_search_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep4" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_quick_na" android:background="@drawable/ic_statusbar_na_up_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep5" android:background="@drawable/ic_statusbar_sep_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_hide" android:background="@drawable/ic_statusbar_hide_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_edge_right" android:background="@drawable/ic_statusbar_edge_left_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
    </LinearLayout>
    <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">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="8.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@android:style/Theme.Holo.Wallpaper" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@android:style/Theme.Holo.Wallpaper" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.TickerView>
    </LinearLayout>
    <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" />
</com.android.systemui.statusbar.CmStatusBarView>
 

donhu

Senior Member
May 6, 2008
668
560
New Hartford, NY
Didn't work for me :( i couldnt create the flashable zip correctly so i pushed the apk to the phone with adb. I also tried just copying it in there and my status bar was missing both times
 

dthomasen

Senior Member
Dec 8, 2007
441
103
Aarhus
www.dthomasen.dk
Didn't work for me :( i couldnt create the flashable zip correctly so i pushed the apk to the phone with adb. I also tried just copying it in there and my status bar was missing both times

Same for me :)

Used this zip: http://www.multiupload.com/ELFHMGUBLE
Open it with winrar (don't extract it), replace the SystemUI.apk file in /system/app/ with the one you've compiled. Then save the zip file again. (DON'T extract at any time, cause that will break the signing of the zip file).

Now you can flash through recovery :)
 

Taine0

Senior Member
Nov 22, 2010
270
664
hmm. I've edited the line you're telling us to, but I'm getting different result :)

screenshot1311003520372.png


Here's my status_bar.xml file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<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:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="6.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true" />
        <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" />
        <com.android.systemui.statusbar.CmBatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
        <com.android.systemui.statusbar.CmBatteryMiniIcon android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/CmBatteryMiniIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center" android:paddingLeft="145.0dip" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />      
        <LinearLayout android:orientation="horizontal" android:id="@id/buttons" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <ImageButton android:id="@id/status_edge_left" android:background="@drawable/ic_statusbar_edge_right_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_home" android:background="@drawable/ic_statusbar_home_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep1" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_menu" android:background="@drawable/ic_statusbar_menu_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep2" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_back" android:background="@drawable/ic_statusbar_back_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep3" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_search" android:background="@drawable/ic_statusbar_search_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep4" android:background="@drawable/ic_statusbar_sep_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_quick_na" android:background="@drawable/ic_statusbar_na_up_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_sep5" android:background="@drawable/ic_statusbar_sep_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_hide" android:background="@drawable/ic_statusbar_hide_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ImageButton android:id="@id/status_edge_right" android:background="@drawable/ic_statusbar_edge_left_bottom" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
    </LinearLayout>
    <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">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="8.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@android:style/Theme.Holo.Wallpaper" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@android:style/Theme.Holo.Wallpaper" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.TickerView>
    </LinearLayout>
    <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" />
</com.android.systemui.statusbar.CmStatusBarView>

Move the clock line to above the linear layout. that way it'll be in the center. At the moment it's getting shoved aside by the notifications.
 
  • Like
Reactions: dthomasen

donhu

Senior Member
May 6, 2008
668
560
New Hartford, NY
Same for me :)

Used this zip: http://www.multiupload.com/ELFHMGUBLE
Open it with winrar (don't extract it), replace the SystemUI.apk file in /system/app/ with the one you've compiled. Then save the zip file again. (DON'T extract at any time, cause that will break the signing of the zip file).

Now you can flash through recovery :)

did everything you said as well and still no bar :( the zip file worked though so thanks for that
 

Top Liked Posts

  • There are no posts matching your filters.
  • 91
    statustesst.png
    pulldownbar.png



    As you can see, I've managed to center the clock and switch the notification and system icons around.
    So I've only tested this mod on CM7 and HDPI.
    I can't see why it wouldn't work on other gingerbread roms, pretty certain all gingerbread have the same type of statusbar.xml to play around with.

    Things you need -
    APKmanager
    Notepad++
    rootexplorer

    How to do it: Use rootexplorer to grab your systemui located system>app.
    Decompile it with APKmanager, go into the layout folder and edit the statusbar.xml.


    For those who want to just edit the clock here is the code to do it.
    find the
    <com.android.systemui.statusbar.Clock' delete that whole line and paste this above the linear layout
    (edit:I updated the clock code to help centering, it'll now be centered for any screensize.)
    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:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center"  android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
        </LinearLayout>

    If you want the whole mod, heres a copy of my XML

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <com.android.systemui.statusbar.StatusBarView 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">
        <com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center" android:paddingLeft="145.0dip" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
        <LinearLayout android:gravity="left" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingLeft="5.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
        <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <com.android.systemui.statusbar.IconMerger android:gravity="right" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="40.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
        </LinearLayout>
        <com.android.systemui.statusbar.CmBatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:gravity="center" android:orientation="horizontal" android:paddingLeft="297.0dip" android:paddingTop="2.5px" android:layout_width="wrap_content" android:layout_height="fill_parent" />
        <com.android.systemui.statusbar.CmBatteryMiniIcon android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/CmBatteryMiniIcon" android:layout_width="0.0px" android:layout_height="0.0px" />
        <ImageButton android:id="@id/status_home" android:background="@drawable/ic_statusbar_home" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
        <ImageButton android:id="@id/status_menu" android:background="@drawable/ic_statusbar_menu" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
        <ImageButton android:id="@id/status_back" android:background="@drawable/ic_statusbar_back" android:paddingRight="6.0dip" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="fill_parent" />
        <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:background="@drawable/statusbar_background" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="8.0dip">
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="25.0dip" android:layout_height="25.0dip" />
            </ImageSwitcher>
            <com.android.systemui.statusbar.TickerView android:id="@id/tickerText" android:paddingTop="5.0px" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
                <TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:textSize="12.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:paddingTop="4.0px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
                <TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:textSize="12.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:paddingTop="4.0px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            </com.android.systemui.statusbar.TickerView>
        </LinearLayout>
        <com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textColor="#ffffffff" 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" />
    </com.android.systemui.statusbar.StatusBarView>

    You will need to change things to fit your own statusbar.xml. I'm on a old nightly for CM7 so it won't have as many things. So you'll have to play around and see what fits.

    Once you edited, save the xml, compile with APKmanager, press Y to both questions, then deleted the resources file and statusbar.xml in the KEEP folder, sign it and then make a flashable zip and flash it over. Or replace the systemui with rootexplorer.

    -----

    Bugs to far: I can't seem to get the notification icons go all the way to the right side, It's not so bad because i've got the battery in place and the gap from the edge fits the battery perfectly, but it's annoying if you don't have the battery % on. I'm sure it's possible to alter it, I'm just not so great with XML.

    Also the notifications overlap the clock when they get to the middle, I know how to fix that one, but just to lazy to bother as I never have that many notifications going on. The width of the notification display just needs changing.

    Play around with it. Let me know how it goes.

    -------
    Notification mod now

    Right, I've now themed the pulldown menu, I'm currently using images from the MEIZU theme as I was testing it out.

    This is done by editting the status_bar_expanded.xml, replace lines that match yours.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <com.android.systemui.statusbar.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <LinearLayout android:orientation="vertical" android:background="@drawable/title_bar_portrait" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="0.0px">
                 <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <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.5dip" android:layout_height="0.0px" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />
               </LinearLayout>
        </LinearLayout>
        <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
            <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
                <com.android.systemui.statusbar.NotificationLinearLayout android:orientation="vertical" android:id="@id/notificationLinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/noNotificationsTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
                    <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/ongoingTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_ongoing_events_title" />
                    <LinearLayout android:orientation="vertical" android:id="@id/ongoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                    <TextView android:textAppearance="@style/TextAppearance.StatusBar.Title" android:gravity="center" android:id="@id/latestTitle" android:background="@drawable/shade_header_background" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_latest_events_title" />
                    <LinearLayout android:orientation="vertical" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                </com.android.systemui.statusbar.NotificationLinearLayout>
       		</ScrollView>
        <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
     </FrameLayout>
      <LinearLayout android:orientation="vertical" android:background="@drawable/title_bar_portrait" android:layout_width="fill_parent" android:layout_height="35.0px">
         <TextView android:gravity="center" android:textSize="14.0sp" android:textStyle="bold" android:textColor="#a6a6a6"  android:id="@id/clear_all_button" android:paddingTop="3.0dip"  android:layout_width="480.0px" android:layout_height="fill_parent" android:scaleType="fitXY" android:text="@string/status_bar_clear_all_button" style="\?android:attr/buttonStyle" />
      </LinearLayout>
      <com.android.systemui.statusbar.powerwidget.PowerWidget  android:id="@id/exp_power_stat"  android:background="@drawable/title_bar_portrait" android:layout_width="fill_parent" android:layout_height="wrap_content" />  
     </com.android.systemui.statusbar.ExpandedView>
    16
    Mini guide

    Hokay, I'll explain the way I make the edits.

    I use APKTool to manage decompiling and rebuilding the apk, simply because I like it. I'm also on Linux and apkmanager doesn't work too well.

    So I have apktool in my path, so I can be anywhere on my system and use it.
    Code:
    cd Android
    mkdir StatusBarMOD
    cd StatusBarMOD
    Copy the SystemUI.apk there, then

    Code:
    apktool d SystemUI.apk
    APK Tool does its thing, then I go to the status_bar.xml and open it up in gedit.

    Editing status_bar.xml


    Centre the clock

    For the clock you need to find this line:
    So CTRL+F, search for "clock" then select the whole line. Your text editor might break it into 2 lines, make sure you get the whole XML tag (between ").

    Delete that, then copy this line to your clipboard:
    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:textSize="15.0sp" android:typeface="normal" android:textStyle="bold" android:textColor="#ff000000" android:gravity="center"  android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
        </LinearLayout>
    If you're using an HDPI phone change this bit
    Code:
    android:paddingTop="2.0px"
    to
    Code:
    android:paddingTop="3.0px"
    and if you're using an LDPI phone change it to
    Code:
    android:paddingTop="1.0px"
    If you're as cool as me, you'll have an MDPI phone, so you can leave it as it is.

    So, line copied to clipboard you need to past it to just BELOW this line:
    Code:
      xmlns:android="http://schemas.android.com/apk/res/android">
    Clock = centred. :D

    Centre the date
    Find this line (it's right at the bottom):
    Now, for this MOD I won't give you a premade version, but I'll tell you what to change (that way we learn :D).
    To centre the clock you need to change the android:gravity property. At the moment it's set to "left|center". All you need to do is change it to "center". If you have a semi transparent status bar and you want to avoid it looking ugly you may also want to extend the date's background across the whole status bar. To do that you need to change the "android:layout_width" property. Instead of "wrap_content" it should say "fill_parent"

    Date = centred

    Flip the status bar icons around

    Ok, so this one is a little weird. You need to change the alignment, the gravity and the order of 2 elements. Each XML tag has an ID, which we'll use to identify the bits we need to move. The ID can be found next to the property "android:id". The battery, signal and 3G icons are part of
    Code:
    android:id="@id/statusIcons"
    So find the tag with that in it (CTRL+F is your friend) then select the whole tag. It's between the bit that says "" The whole thing will look something like this:
    You need to cut it out (CTRL+X), and move it to just BELOW the LinearLayout with the ID
    Code:
    android:id="@id/icons"
    So once moved, we need to change the alignment and the gravity. Near the end of the line you just moved it has this property:
    Code:
    android:layout_alignParentRight="true"
    You need to change it to
    Code:
    android:layout_alignParentLeft="true"
    You also need to change the android:gravity to
    Code:
    android:gravity="left"
    Part one sorted.

    To move the notifications over to the right you need to do this:
    In the tag ID'd
    Code:
    android:id="@id/icons"
    you need to change the alignment to right (alignParentLeft to alignParentRight) and change the gravity to "right"

    Rebuilding the apk


    Go back to your command line and issue this:
    Code:
    apktool b SystemUI
    In the folder you decompiled in you will see a folder named SystemUI. Once you rebuild your apk using apktool you'll notice that 2 new folders are in that folder (the SystemUI one): build and dist. Go into the build folder, then apk --> res --> layout. Also, make a backup of your original SystemUI.apk, then open the original using 7zip, winrar or the archive manager on linux. DO NOT EXTRACT THE ARCHIVE, JUST OPEN IT! Now, within the archive, navigate to res --> layout. Go back to the folder you just opened, and drag the status_bar.xml found there into the archive window, overwriting the status_bar.xml already there. Close everything, then push the now modified SystemUI.apk to your phone using ADB and reboot. Job done!



    I may edit this post after I publish it, to fix typos and the like.

    Hope this helps y'all!

    I might also add that, as an Englishman, spelling "centre" as "center" is a nightmare. Oh so often my compile fails because I spelt centre correctly.
    9
    See the above post now, its arranged properly now. I want center clock and transparency too. I mean full transparent.
    Okay i want you to tell me what to edit, so that i can learn too. It will be a big favor. Thanks mate for helping (XDA needs more and more helping guys like you)
    Thank you...

    First, delete your stock clock line. Looks like this

    Code:
    <com.android.systemui.statusbar.Clock

    Delete that entire line

    Next, @ your 3rd line here:

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

    Place your cursor at the end of that line, press enter to make a blank line

    Now in that blank line copy/paste 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:textSize="15.0sp" android:typeface="normal" android:textStyle="bold" android:textColor="#ffffffff" android:gravity="center"  android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
        </LinearLayout>

    After pasting it make sure everything lines up

    Next, look for this line

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

    after the @id/ticker text, copy/paste this

    Code:
    android:background="@drawable/statusbar_background"

    This will stop the overlapping text you get when you receive a notification

    Now for transparency

    At your second to last line here

    Code:
    <com.android.systemui.statusbar.DateView

    Change the android:background to this

    Code:
    "@android:color/transparent"

    Next make the smali edit

    Navigate to your decompiled SystemUI folder, then goto smali/com/android/systemui/statusbar/StatusBarService.smali

    Edit it with Notepad++ or whatever text editor you have

    Search for this line

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

    Right above it you'll see

    Code:
    const/4 v5, 0x2

    Change it to

    Code:
    const/4 v5, -0x3

    Now, if your using apktool, compile your SystemUI and sign it using apk manager. Then make a flashable zip. To be honest, I only use apktool to compile/decompile and use apk manager to sign so I can't really comment on what the process is if you use anything besides apktool to decompile/compile

    Hope this was helpful
    9

    BACKUP WORKING FILES!!

    Dont download someone else's file and try to flash it!


    The trouble most people run into is that they "install" the apks incorrectly, not that they're doing the mod wrong....

    ADB:
    Code:
    adb remount
    adb push newSystemUI.apk /system/app/SystemUI.apk
    adb push newframework-res.apk /system/framework/framework-res.apk
    adb reboot

    ROOT EXPLORER:

    Simple, just take note of what the permissions are on the files are when its working. Then copy the new files over those, make sure to rename them correctly. Then set the permissions back to what they were before.

    I dont know how to make a successful flashable zip and it takes forever to reboot, go into recovery blah blah blah.

    If your bar disappears then PM me telling me exactly what you did/didn't do lol

    Dont click thanks until your mod works, so i can know what's going on and keep the thread clean at the same time :D

    LimitedTime
    KKQ29
    Marcus
    Chiefy009
    Kanttii
    Kanttii - just center clock and shifted icons
    Scratch0805
    Dizgustipated
    Stajlerboy
    E.Cadro
    5
    @jaydubbs: http://dl.dropbox.com/u/3382637/Android/StatusBarMods/jaydubbs/SystemUI.apk

    @Irisscience: http://dl.dropbox.com/u/3382637/Android/StatusBarMods/Irisscience/SystemUI.apk

    @ama761156: http://dl.dropbox.com/u/3382637/Android/StatusBarMods/ama761156/SystemUI.apk

    @kancrutt (I can't make the statusbar transparent, you need a deodexed ROM for that to happen. Sorry dude) : http://dl.dropbox.com/u/3382637/Android/StatusBarMods/kancrutt/SystemUI.apk

    @matthieup: http://dl.dropbox.com/u/3382637/Android/StatusBarMods/matthieup/SystemUI.apk

    @galaxy1210: http://dl.dropbox.com/u/3382637/Android/StatusBarMods/galaxy1210/SystemUI.apk

    ========================

    K Dotty, no. :(. I've even synced the CM source code and had a look through there, but I can't find any reference to it's width. I'm learning Java at the moment, so I'll keep looking until I crack it. :D