Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Taine0

18th July 2011, 02:10 PM   |  #1  
OP Senior Member
Thanks Meter: 683
 
270 posts
Join Date:Joined: Nov 2010



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 by Taine0; 21st July 2011 at 03:56 PM.
The Following 91 Users Say Thank You to Taine0 For This Useful Post: [ View ]
18th July 2011, 02:51 PM   |  #2  
Che123's Avatar
Senior Member
Thanks Meter: 11
 
605 posts
Join Date:Joined: Aug 2009
More
nice work - but you got many smilies in your code
may you should use the code-tags

Wouldn't it be possible to add this into a theme chooser apk ?
18th July 2011, 03:10 PM   |  #3  
vukandric's Avatar
Senior Member
Flag Belgrade
Thanks Meter: 1,219
 
2,699 posts
Join Date:Joined: Sep 2009
Donate to Me
More
This is really interesting. Will have a look how to get it on miui rom. Thanks for sharing!

Sent from my GT-I9000 using XDA Premium App
The Following User Says Thank You to vukandric For This Useful Post: [ View ]
18th July 2011, 03:46 PM   |  #4  
whooper90's Avatar
Senior Member
Flag Aarhus
Thanks Meter: 91
 
405 posts
Join Date:Joined: Dec 2007
More
just tried this.. and my statusbar disapeared
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

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 by whooper90; 18th July 2011 at 03:56 PM.
18th July 2011, 04:07 PM   |  #5  
OP Senior Member
Thanks Meter: 683
 
270 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by Che123

nice work - but you got many smilies in your code
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.

Quote:
Originally Posted by whooper90

just tried this.. and my statusbar disapeared
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

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.
18th July 2011, 04:10 PM   |  #6  
whooper90's Avatar
Senior Member
Flag Aarhus
Thanks Meter: 91
 
405 posts
Join Date:Joined: Dec 2007
More
Quote:
Originally Posted by Taine0

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.
18th July 2011, 04:14 PM   |  #7  
OP Senior Member
Thanks Meter: 683
 
270 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by whooper90

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.

systemui.apk needs to be signed to work, so that could be your problem.
18th July 2011, 04:24 PM   |  #8  
whooper90's Avatar
Senior Member
Flag Aarhus
Thanks Meter: 91
 
405 posts
Join Date:Joined: Dec 2007
More
Quote:
Originally Posted by Taine0

systemui.apk needs to be signed to work, so that could be your problem.

Hmm.. signed the APK using test-keys.. Same result..
You don't happen to know a way to create a flashable .zip without apkmanager?
18th July 2011, 04:26 PM   |  #9  
Senior Member
Thanks Meter: 90
 
799 posts
Join Date:Joined: Apr 2010
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
18th July 2011, 04:27 PM   |  #10  
OP Senior Member
Thanks Meter: 683
 
270 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by whooper90

Hmm.. signed the APK using test-keys.. Same result..
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

Quote:
Originally Posted by SwiftLegend

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 by Taine0; 18th July 2011 at 04:31 PM.

The Following 2 Users Say Thank You to Taine0 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes