FORUMS
Remove All Ads from XDA

[MOD]Permanent Date in Statusbar - Center Date for AOKP

1,355 posts
Thanks Meter: 480
 
Post Reply Email Thread
This mod will let the date always displaying in statusbar, like the clock does..check the screenshot. I also removed date from notification header, since it's already in statusbar.
For the center date in AOKP go to the end of the post.
Always backup before you try anything!



You have to decompile(apk manager does it) SystemUI.apk.

Go to file SystemUI.apk\res\layout\status_bar.xml
find the line 15
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
place on top of it the line
Code:
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_toLeftOf="@id/clock" />
so it will look like that
Code:
        </LinearLayout>
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_toLeftOf="@id/clock" />
        <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>
now here, I set the
Code:
android:paddingLeft="4.0dip"
with the same value in both clock and date, so they have the same space at the left.

With this setup, you will always see date and then clock at the right of the statusbar(I haven't test something else yet).

if you want to delete the date from the notification header, do the following
in the file SystemUI.apk\res\layout\status_bar_expanded.xml delete the following line
Code:
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
and in the line
Code:
<ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
replace the
Code:
android:layout_toRightOf="@id/date"
with the following(it maybe not crucial, but I did it)
Code:
android:layout_alignParentLeft="true"
it should look something like that



the text size is probably looking different between date and clock, so in the file SystemUI.apk\res\values\styles.xml is the text size of both.
clock
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@android:style/TextAppearance.StatusBar.Icon">
        <item name="android:textSize">16.0dip</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">@android:color/holo_blue_light</item>
    </style>
and date
Code:
<style name="TextAppearance.StatusBar.Date" parent="@android:style/TextAppearance.StatusBar.Icon">
        <item name="android:textSize">16.0sp</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">@android:color/holo_blue_light</item>
    </style>
I changed both with
Code:
<item name="android:textSize">14.0sp</item>
Center Date in AOKP roms
although if you enable every statusbar icon(bt, vibrate,alarm,wifi etc) it will look messy cause the clock overlapse the icons.

since AOKP rom has an option to set the clock in the center, it's quite easy to have the date in that order too.

in file SystemUI.apk\res\layout\status_bar.xml copy&delete or cut the line
Code:
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_toLeftOf="@id/clock" />
and place it in top of (watch the centerclock, not just clock)
Code:
<com.android.systemui.statusbar.policy.CenterClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
so it will look like that
Code:
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/center_clock_layout" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_toLeftOf="@id/center_clock" />
        <com.android.systemui.statusbar.policy.CenterClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>
now in the end of the line you cut/copied change the "@id/clock" into "@id/center_clock", so it will look like that
Code:
android:layout_toLeftOf="@id/center_clock"
now you're good to go, it will look like that(it won't be in italic, I just changed it) and choose center clock in ROM control options in settings, otherwise you'll have center date and clock at the right which is also nice



I hope I didn't forget anything

Recompile and push it/flash it.

submit your comments and mods, left, center date or whatever
The Following 19 Users Say Thank You to nikosrs4 For This Useful Post: [ View ] Gift nikosrs4 Ad-Free
 
 
11th February 2012, 01:46 PM |#2  
reverepats's Avatar
Senior Member
Flag Boston,MA
Thanks Meter: 5,404
 
Donate to Me
More
Wow
..that's def the coolest MOD I've seen in a while. I don't think I've seen anyone do this before. I'm not home, but as soon as I get back I'm def gonna try this. Good job man!!!!

Sent from my Galaxy Nexus using xda premium
11th February 2012, 01:49 PM |#3  
winwiz's Avatar
Senior Member
Thanks Meter: 658
 
More
This is brilliant! Many thanks

any chance of making this a flashable CWM ZIP?
Also, is it possible to show dBm (signal strength) in the status bar?
11th February 2012, 01:59 PM |#4  
nikosrs4's Avatar
OP Senior Member
Thanks Meter: 480
 
Donate to Me
More
I have a flashable for AOKP MS3 including this mod(small thumbs) http://forum.xda-developers.com/show....php?t=1480309 cause this is how I use it and the softkeys of the screenshot

please backup before you try anything.

@winwiz, for the db it should need work which unfortunately I don't know how
Attached Files
File Type: zip statusbar_date_AOKP_MS3.zip - [Click for QR Code] (1.12 MB, 448 views)
The Following User Says Thank You to nikosrs4 For This Useful Post: [ View ] Gift nikosrs4 Ad-Free
11th February 2012, 10:29 PM |#5  
Junior Member
Thanks Meter: 2
 
More
Any chance you wouldn't mind post your wallpaper? I just taught that book to my students last week actually. Good timing Oh and thanks for the mod too, of course. Cheers!

Sent from my Galaxy Nexus using XDA App
11th February 2012, 11:33 PM |#6  
sert00's Avatar
Senior Member
Flag cesena,IT
Thanks Meter: 504
 
More
clap-clap!very good mod man!the best of the lastest inserted in roms out there.applying that in this moment,and thank you very much!very appreciated!
11th February 2012, 11:47 PM |#7  
nikosrs4's Avatar
OP Senior Member
Thanks Meter: 480
 
Donate to Me
More
Quote:
Originally Posted by tlspatt

Any chance you wouldn't mind post your wallpaper? I just taught that book to my students last week actually. Good timing Oh and thanks for the mod too, of course. Cheers!

Sent from my Galaxy Nexus using XDA App

sure
http://img21.imageshack.us/img21/705...r715037662.jpg
Quote:
Originally Posted by sert00

clap-clap!very good mod man!the best of the lastest inserted in roms out there.applying that in this moment,and thank you very much!very appreciated!

did you try the flashable zip? does it work? cause I think I left something different in this zip . check the notification background if it is ok(semi transparent like the default)
12th February 2012, 12:51 AM |#8  
sert00's Avatar
Senior Member
Flag cesena,IT
Thanks Meter: 504
 
More
nope i'm doing...the sig report m3 but this morning i flashed another rom.my phone now is total empty,it takes me less time to flash m3 and after that flash yours zip,instead of doing mine the mod because it takes me more times that the cwm zip.phone is total wiped,no prob at all
i'll report this in 5 minutes

EDIT if you mean the background above the notification widget is semi-trasparent like before apply the mod..for me it's ok.now i stick with m3 and add my mod to your package.
ps...you have done the mod with modded systemUI right?because softkeys changed...!:)
i'll remake all with my systemUI (to have all my mods+your mod in one package)
very thnks for mod.for me so usefull!

EDIT 2 ok,managed.done your modification (date)over my mod (circlemod by hoolms standard+mixed softkey (2 packs)of atticus192.:)


12th February 2012, 02:48 AM |#9  
Member
Thanks Meter: 36
 
More
We NEED a developer to come in here and tell us how to center the date and clock. I'm all for doing it myself but I don't know what to code
12th February 2012, 05:07 AM |#10  
jgrimberg1979's Avatar
Senior Member
Flag D.C
Thanks Meter: 215
 
More
Is there any way to make the date format like such: mo/day/year ex. 02/12/12?
12th February 2012, 01:16 PM |#11  
nikosrs4's Avatar
OP Senior Member
Thanks Meter: 480
 
Donate to Me
More
Quote:
Originally Posted by sert00

ps...you have done the mod with modded systemUI right?because softkeys changed...!:)
i'll remake all with my systemUI (to have all my mods+your mod in one package)
very thnks for mod.for me so useful!

glad you like it. yes I had the custom softkeys in the zip, sorry about that, I edited the post.
Quote:
Originally Posted by number3pencil

We NEED a developer to come in here and tell us how to center the date and clock. I'm all for doing it myself but I don't know what to code

one way could be by editing arrays.xml in framework and putting it in front of the other icons, I tried it but it didn't work, I got a bootloop.
Quote:
Originally Posted by jgrimberg1979

Is there any way to make the date format like such: mo/day/year ex. 02/12/12?

I was searching for that too. We need to have SHORT date appearance cause now it's LONG, but the date format is mentioned in system locale and I haven't found another way. If you change the language of the phone, it will change that too(if locale changes it)
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes