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

Search This thread

igavio

Member
Aug 6, 2008
14
0
Localization strings

Is there a way for the date to appear in the local language?
For example, Δευτερα, 10 Μαρτιος 2012 in greek or whatever language the phone's locale is.
 

nikosrs4

Senior Member
Nov 17, 2006
1,470
510
www.thelenscape.com
Xiaomi Poco F3
Is there a way for the date to appear in the local language?
For example, Δευτερα, 10 Μαρτιος 2012 in greek or whatever language the phone's locale is.
are you talking about this mod or in general? It should use the phone's locale, but I haven't tried it cause I always have it in English and now I use AOKP M4 which is different and I haven't applied this mod.
 

igavio

Member
Aug 6, 2008
14
0
are you talking about this mod or in general? It should use the phone's locale, but I haven't tried it cause I always have it in English and now I use AOKP M4 which is different and I haven't applied this mod.

I am talking about this mod in particular. In the XML file nikosrs4 is editing, there is no mention of locale or specific format string for the date.

Anyway, mine isn't AOKP, so the strings mentioned in this mod do not match mine.
 

nikosrs4

Senior Member
Nov 17, 2006
1,470
510
www.thelenscape.com
Xiaomi Poco F3
I am talking about this mod in particular. In the XML file nikosrs4 is editing, there is no mention of locale or specific format string for the date.

Anyway, mine isn't AOKP, so the strings mentioned in this mod do not match mine.

Yes that's true, there is no Locale in these xmls. But I found a Locale mention in a smali file in systemui but I don't have that knowledge to work it out unfortunately.

Sent from my Galaxy Nexus
 

brez

New member
Dec 13, 2011
4
30
warrington
Yes that's true, there is no Locale in these xmls. But I found a Locale mention in a smali file in systemui but I don't have that knowledge to work it out unfortunately.

Sent from my Galaxy Nexus



On AOKP there are 2 ways.

This first part is only for AOKP roms!!
You can change the small "Day of the week" that is next to the clock via SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali
find the line
Code:
const-string v25, "\uef02EEE \uef03"
and change the EEE to whatever you want.
Code:
EEEE	Day of week FULL  eg Sunday
EEE	Day of week  SHORT  eg Sun
	
dd	Day of the month 01-31
d	Day of the month 1-31
	
MM	Month 01 -12
M	Month 1-12
MMM	Month name SHORT  eg Jan
MMMM	Month  name FULL  eg January
	
yyyy	Year 4 digit
yy	Year 2 digit
	
kk	Hour 24
h	Hour 12
mm 	Minute
a	AM / PM indicator
zzzz	Time zone eg GMT+01:00


Any extra characters you want displayed ( / , . -) need to be inside an 'apostrophe'.
So Sun 10/6 (Sun 10th June in UK format) would be
Code:
    const-string v25, "\uef02[COLOR="Lime"]EEE d'/'M[/COLOR] \uef03"


Screenshot_2012-06-10-23-37-37.jpg






If your on a none AOKP rom (or if you want to change the expanded date view) you need to change 2 things.

First go to SystemUI.apk\res\values\strings.xml and change
Code:
    <string name="status_bar_date_formatter">%[COLOR="Red"]2[/COLOR]$s</string>
to
Code:
    <string name="status_bar_date_formatter">%[COLOR="Lime"]1[/COLOR]$s</string>

then go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\DateView.smali and find
Code:
    const-string v4, "EEEE"
and change the "EEEE" to whatever you want.

So Sunday 10 June 2012 would be
Code:
    const-string v4, "EEEE d MMMM yyyy"
 

Attachments

  • Screenshot_2012-06-10-23-37-37.jpg
    Screenshot_2012-06-10-23-37-37.jpg
    15 KB · Views: 827
  • Screenshot_2012-06-10-23-38-05.png
    Screenshot_2012-06-10-23-38-05.png
    23.9 KB · Views: 911
Last edited:

nikosrs4

Senior Member
Nov 17, 2006
1,470
510
www.thelenscape.com
Xiaomi Poco F3
On AOKP there are 2 ways.

This first part is only for AOKP roms!!
You can change the small "Day of the week" that is next to the clock via SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali
find the line
Code:
const-string v25, "\uef02EEE \uef03"
and change the EEE to whatever you want.
Code:
EEEE	Day of week FULL  eg Sunday
EEE	Day of week  SHORT  eg Sun
	
dd	Day of the month 01-31
d	Day of the month 1-31
	
MM	Month 01 -12
M	Month 1-12
MMM	Month name SHORT  eg Jan
MMMM	Month  name FULL  eg January
	
yyyy	Year 4 digit
yy	Year 2 digit
	
kk	Hour 24
h	Hour 12
mm 	Minute
a	AM / PM indicator
zzzz	Time zone eg GMT+01:00


Any extra characters you want displayed ( / , . -) need to be inside an 'apostrophe'.
So Sun 10/6 (Sun 10th June in UK format) would be
Code:
    const-string v25, "\uef02[COLOR="Lime"]EEE d'/'M[/COLOR] \uef03"


Screenshot_2012-06-10-23-37-37.jpg






If your on a none AOKP rom (or if you want to change the expanded date view) you need to change 2 things.

First go to SystemUI.apk\res\values\strings.xml and change
Code:
    <string name="status_bar_date_formatter">%[COLOR="Red"]2[/COLOR]$s</string>
to
Code:
    <string name="status_bar_date_formatter">%[COLOR="Lime"]1[/COLOR]$s</string>

then go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\DateView.smali and find
Code:
    const-string v4, "EEEE"
and change the "EEEE" to whatever you want.

So Sunday 10 June 2012 would be
Code:
    const-string v4, "EEEE d MMMM yyyy"
very helpful, thank you !! :)
 
  • Like
Reactions: x-dira

x-dira

Senior Member
Nov 6, 2011
436
126
On AOKP there are 2 ways.


then go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\DateView.smali and find
Code:
    const-string v4, "EEEE"
and change the "EEEE" to whatever you want.

So Sunday 10 June 2012 would be
Code:
    const-string v4, "EEEE d MMMM yyyy"


Hi. Im mod in cm7 notifiacation, but miss day of the week....u can help....plzz

yeah...i am mod succes, but miss day of the week (July/29/2012 miss Sunday)
how to full dateview? (eg: Sun/july/29/2012)
I need help, !
Thanks
shot000003r.png

http://img833.imageshack.us/img833/8645/shot000002m.png
screenshot10ax.png


file systemui link: http://www.mediafire.com/?wt7z8rs84wsyipy

http://xdaforums.com/showthread.php?t=1561394&page=13
 

amchandr

Senior Member
Oct 19, 2009
119
16
I tried this mod on Samsung Galaxy Note 2 i317, it did not work.
In fact I decompiled & compiled the SystemUI.apk successfully. But somehow the changes are not reflecting.

Can someone help me?
 

nikosrs4

Senior Member
Nov 17, 2006
1,470
510
www.thelenscape.com
Xiaomi Poco F3
I tried this mod on Samsung Galaxy Note 2 i317, it did not work.
In fact I decompiled & compiled the SystemUI.apk successfully. But somehow the changes are not reflecting.

Can someone help me?

If it's stock, it has touchwiz framework too, that's why it didn't work. They need to be changed too but I don't know the procedure :(

Sent from my Galaxy Nexus using Tapatalk 4
 

nikosrs4

Senior Member
Nov 17, 2006
1,470
510
www.thelenscape.com
Xiaomi Poco F3
@nikosrs4 I am trying to do this mod for a Nexus 4, on android 4.3, AOSP rom. What lines do I edit because I can't find the lines that you said I have to post above. I thought I'd try it anyway but it didn't turn out right. Here's the link for my status_bar.xml: https://www.dropbox.com/s/5663ax6wwpqx5fn/status_bar.xml
you're using a custom rom, did you see if it has the option to have the date there? also, you have enabled the center clock, you have to disable it.
Does your xml include the date or is the rom's default one? cause I can't find the date line.
 

22sl22

Senior Member
May 21, 2012
3,530
3,277
London
you're using a custom rom, did you see if it has the option to have the date there? also, you have enabled the center clock, you have to disable it.
Does your xml include the date or is the rom's default one? cause I can't find the date line.

The xml attached is the rom's default one. There is no option in the rom, i'm trying to add it and make a mod. The rom i'm using has the option to use either left clock or center clock
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    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!

    screenshot2012021102411.jpg


    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>
            [COLOR="Red"]<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" />[/COLOR]
        </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

    tut1ec.jpg


    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:
    [COLOR="Red"]<item name="android:textSize">[B]14.0sp[/B]</item>[/COLOR]

    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.[COLOR="Red"]CenterClock[/COLOR] 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 :p

    screenshot2012021217212.png


    I hope I didn't forget anything :)

    Recompile and push it/flash it.

    submit your comments and mods, left, center date or whatever :)
    6
    Yes that's true, there is no Locale in these xmls. But I found a Locale mention in a smali file in systemui but I don't have that knowledge to work it out unfortunately.

    Sent from my Galaxy Nexus



    On AOKP there are 2 ways.

    This first part is only for AOKP roms!!
    You can change the small "Day of the week" that is next to the clock via SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali
    find the line
    Code:
    const-string v25, "\uef02EEE \uef03"
    and change the EEE to whatever you want.
    Code:
    EEEE	Day of week FULL  eg Sunday
    EEE	Day of week  SHORT  eg Sun
    	
    dd	Day of the month 01-31
    d	Day of the month 1-31
    	
    MM	Month 01 -12
    M	Month 1-12
    MMM	Month name SHORT  eg Jan
    MMMM	Month  name FULL  eg January
    	
    yyyy	Year 4 digit
    yy	Year 2 digit
    	
    kk	Hour 24
    h	Hour 12
    mm 	Minute
    a	AM / PM indicator
    zzzz	Time zone eg GMT+01:00


    Any extra characters you want displayed ( / , . -) need to be inside an 'apostrophe'.
    So Sun 10/6 (Sun 10th June in UK format) would be
    Code:
        const-string v25, "\uef02[COLOR="Lime"]EEE d'/'M[/COLOR] \uef03"


    Screenshot_2012-06-10-23-37-37.jpg






    If your on a none AOKP rom (or if you want to change the expanded date view) you need to change 2 things.

    First go to SystemUI.apk\res\values\strings.xml and change
    Code:
        <string name="status_bar_date_formatter">%[COLOR="Red"]2[/COLOR]$s</string>
    to
    Code:
        <string name="status_bar_date_formatter">%[COLOR="Lime"]1[/COLOR]$s</string>

    then go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\DateView.smali and find
    Code:
        const-string v4, "EEEE"
    and change the "EEEE" to whatever you want.

    So Sunday 10 June 2012 would be
    Code:
        const-string v4, "EEEE d MMMM yyyy"
    1
    I have a flashable for AOKP MS3 including this mod(small thumbs) http://xdaforums.com/showthread.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 :p
    1
    ok, I have center clock in AOKP rom, very easy, how-to at the end of the 1st post.

    screenshot2012021217212.png
    1
    On AOKP there are 2 ways.

    This first part is only for AOKP roms!!
    You can change the small "Day of the week" that is next to the clock via SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali
    find the line
    Code:
    const-string v25, "\uef02EEE \uef03"
    and change the EEE to whatever you want.
    Code:
    EEEE	Day of week FULL  eg Sunday
    EEE	Day of week  SHORT  eg Sun
    	
    dd	Day of the month 01-31
    d	Day of the month 1-31
    	
    MM	Month 01 -12
    M	Month 1-12
    MMM	Month name SHORT  eg Jan
    MMMM	Month  name FULL  eg January
    	
    yyyy	Year 4 digit
    yy	Year 2 digit
    	
    kk	Hour 24
    h	Hour 12
    mm 	Minute
    a	AM / PM indicator
    zzzz	Time zone eg GMT+01:00


    Any extra characters you want displayed ( / , . -) need to be inside an 'apostrophe'.
    So Sun 10/6 (Sun 10th June in UK format) would be
    Code:
        const-string v25, "\uef02[COLOR="Lime"]EEE d'/'M[/COLOR] \uef03"


    Screenshot_2012-06-10-23-37-37.jpg






    If your on a none AOKP rom (or if you want to change the expanded date view) you need to change 2 things.

    First go to SystemUI.apk\res\values\strings.xml and change
    Code:
        <string name="status_bar_date_formatter">%[COLOR="Red"]2[/COLOR]$s</string>
    to
    Code:
        <string name="status_bar_date_formatter">%[COLOR="Lime"]1[/COLOR]$s</string>

    then go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\DateView.smali and find
    Code:
        const-string v4, "EEEE"
    and change the "EEEE" to whatever you want.

    So Sunday 10 June 2012 would be
    Code:
        const-string v4, "EEEE d MMMM yyyy"
    very helpful, thank you !! :)