Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,401 Members 38,364 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Taine0
Old
(Last edited by Taine0; 21st July 2011 at 02:56 PM.)
#1  
Senior Member - OP
Thanks Meter 682
Posts: 270
Join Date: Nov 2010
Default [Status bar/notification mod] Center clock and icon switch - CM7/gingerbread - update




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:
Select 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:
Select 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:
Select 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>
-------------------------------------
Check out my icon set!
Metrogloss icons.
If I help you, please click the 'thanks' button!

2.2 rooted
The Following 91 Users Say Thank You to Taine0 For This Useful Post: [ Click to Expand ]
 
Che123
Old
#2  
Che123's Avatar
Senior Member
Thanks Meter 11
Posts: 604
Join Date: Aug 2009
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 ?
Xiaomi Mi3 WCDMA 64 GB
WiUi 4.6.20 | CWM Rayglobe v6.0.3.2


Samsung Galaxy Note 10.1 n8010
Stock unrooted



Pc Suite Batch collection & Font Flasher

Our Blog >>

Device-History:
 
vukandric
Old
#3  
vukandric's Avatar
Senior Member
Thanks Meter 1219
Posts: 2,699
Join Date: Sep 2009
Location: Belgrade

 
DONATE TO ME
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: [ Click to Expand ]
 
whooper90
Old
(Last edited by whooper90; 18th July 2011 at 02:56 PM.)
#4  
whooper90's Avatar
Senior Member
Thanks Meter 90
Posts: 401
Join Date: Dec 2007
Location: Aarhus
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)
Hit thanks if I helped you out!
Regards Dennis Aka. Whooper
Computer Science @ University of Aarhus
 
Taine0
Old
#5  
Senior Member - OP
Thanks Meter 682
Posts: 270
Join Date: Nov 2010
Quote:
Originally Posted by Che123 View Post
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 View Post
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.
-------------------------------------
Check out my icon set!
Metrogloss icons.
If I help you, please click the 'thanks' button!

2.2 rooted
 
whooper90
Old
#6  
whooper90's Avatar
Senior Member
Thanks Meter 90
Posts: 401
Join Date: Dec 2007
Location: Aarhus
Quote:
Originally Posted by Taine0 View Post
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.
Hit thanks if I helped you out!
Regards Dennis Aka. Whooper
Computer Science @ University of Aarhus
 
Taine0
Old
#7  
Senior Member - OP
Thanks Meter 682
Posts: 270
Join Date: Nov 2010
Quote:
Originally Posted by whooper90 View Post
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.
-------------------------------------
Check out my icon set!
Metrogloss icons.
If I help you, please click the 'thanks' button!

2.2 rooted
 
whooper90
Old
#8  
whooper90's Avatar
Senior Member
Thanks Meter 90
Posts: 401
Join Date: Dec 2007
Location: Aarhus
Quote:
Originally Posted by Taine0 View Post
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?
Hit thanks if I helped you out!
Regards Dennis Aka. Whooper
Computer Science @ University of Aarhus
 
SwiftLegend
Old
#9  
Senior Member
Thanks Meter 90
Posts: 799
Join Date: 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

Verizon Galaxy Note 2 - PAC Rom
Verizon Galaxy Nexus - Xylon/Just laying around
Nexus 7 - Latest Paranoid Android build
Transformer 101 - *Retired*
Jailbroken iPad 3 - *Shattered screen, not usable*
2013 Macbook Pro - Slowly becoming my baby
 
Taine0
Old
(Last edited by Taine0; 18th July 2011 at 03:31 PM.)
#10  
Senior Member - OP
Thanks Meter 682
Posts: 270
Join Date: Nov 2010
Quote:
Originally Posted by whooper90 View Post
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 View Post
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.
-------------------------------------
Check out my icon set!
Metrogloss icons.
If I help you, please click the 'thanks' button!

2.2 rooted

The Following 2 Users Say Thank You to Taine0 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes