FORUMS

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services … more

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more … more

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

Guide/tutorial-statusbar clock-add seconds,day of week,date-full customiztion options

924 posts
Thanks Meter: 1,138
 
By rastigo, Senior Member on 31st August 2014, 09:25 PM
Post Reply Subscribe to Thread Email Thread
This guide will help you in customizing the statusbar clock and play with it a bit. This mod requires a deodexed LGSystemUI.apk. It took me about a month to cook this mod.This guide couldnt have been possible without @Ticklefish , so I thank him for his terrific knowledge and his willingness to help others.

Special thanks to @Spannaa for his guide based on which this one was made...Truly awesome both @Spannaa and @Ticklefish

Basically an inbuilt android function called "TEXTCLOCK" is used in the mod to display clock in html code


You need to have knowledge of compiling and decompiling ...Tools recommended:
Apktool 1.5.2 (coz it handles smali files perfectly, although we don't touch any of them in this mod)
Notepad++

Remember the variable used should be in format like :
Quote:

<b>...</b> ..................................makes the the enclosed text bold
<i>...</i>...................................makes the the enclosed text italic
<font size=xx>...</font>............sets the font size of the enclosed text to X.0dip
<font fgcolor ="#ffffffff">...</>........sets the foreground colour of the enclosed text
<font bgcolor ="#ff000000">...</>... .sets the background colour of the enclosed text
fgcolor and bgcolor set the foreground and background color. Note that these attributes should be in hexcode like “#ff00ff00”.
<u>...</u>.... Underlines the text
<strike>...</strike>.... creates a strikethrough


There are lots of options for customizations available. You can change the strings above using any of the following.


Quote:

d.............Day Of Month " 1"
dd.......... Day Of Month adds Zero before,"01"
EEEE......Day Of Week "Tuesday"
EEE........Week Day short "Tue"
MMMM....Month "SEPTEMBER"
MMM.......Month short "SEP"
MM..........Month adds zero before "09"
M............Month "9"
yyyy........Year "2014"
yy............Year Short "14"
h..............Hour 12 hour, 5
hh............Hour adds zero before "08"
H.............Hour 24 hour 5pm="5/17"
HH...........Hour 24 hour add zero before ie. 5am = "05"
In some ROMs if "HH" won't work replace the same with "kk" instead of "HH"
m.............Minute 5 min="5"
mm..........Minute add zero before 5min ="05"
s..............Second 7secs ="7"
ss............Second add zero before 7sec="07"
a..............AM/PM

Step 1
Decompile your LGSystemUI.apk. Edit /res/layout/statusbar.xml and find the line:

HTML Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
V.Imp: Do not delete this line...Just hide the clock by adding "andoid:visibility="gone""
Change it to

HTML Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:visibility="gone" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

Step 2

Just below that line add the following code:


HTML Code:
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />


VVV IMP: The above line must be below the stock clock code or the statusbar will crash

Step 3

Open /res/values/strings and add the following strings at the end.


HTML Code:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm</string>


You can change this to what is mentioned before with your choice of clock format

Step 4
Open/res/values/styles and find


HTML Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
        <item name="android:textSize">18.0dip</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">#ffffffff</item>
Here you can customize size.bold,colour of the clock

Step 5
Recompile your LGSystemUI.apk.
Copy meta_inf folder and AndroidManifest.xml from original file to recompiled file.
Rename the recompiled file as LGSystemUI.apk
Push to /system/priv-app with 644 permissions.
Reboot and enjoy the mod.

For eg. my strings read as follows:


HTML Code:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm:ss<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm:ss</string>
Output of which is as under:

Click image for larger version

Name:	screenshot.png
Views:	971
Size:	32.7 KB
ID:	2919792


For those who arent profoud with compile/decompile...I am posting a G2 STOCK KK LGSystemUI.apk for download. It has

-Short day of the week.
-Clock with seconds
-Small am/pm
SCRRENSHOT:Click image for larger version

Name:	screenshota.png
Views:	984
Size:	35.3 KB
ID:	2919858
Rename to LGSystemUI.apk and push to /system/priv-app with 644 permissions and delete the LGSystemUI.odex file.

Stock G2 KK Download





You have to play around a bit with the strings added to strings.xml in order to figure out your desired result





A lot of hardwork went into making this guide so please show appreciation by pressing thanks button. Please also give credit if youve used this in your MODS/ROM
Last edited by rastigo; 1st September 2014 at 05:38 AM.
The Following 20 Users Say Thank You to rastigo For This Useful Post: [ View ]
 
 
31st August 2014, 09:47 PM |#2  
glfsd's Avatar
Senior Member
Thanks Meter: 569
 
Donate to Me
More
thanks rastigo.
a clarification, if "HH" does not work, replace with "kk"
The Following User Says Thank You to glfsd For This Useful Post: [ View ]
1st September 2014, 12:12 AM |#3  
TyJones916's Avatar
Senior Member
Sac-Town
Thanks Meter: 20
 
More
Very helpful!! Thanks!!
1st September 2014, 06:54 AM |#4  
leonevo's Avatar
Junior Member
Flag Salamanca
Thanks Meter: 17
 
More
Thanks mate!!!
Great job
6th September 2014, 02:04 PM |#5  
XxZombiePikachu's Avatar
Recognized Contributor
Flag Florida
Thanks Meter: 1,555
 
More
So I am finally testing this but have fun into an issue not sure what could have gone wrong, systemui is deodexed and the strings are there but 24 hour clock looks like this


And 12 hour clock same but last number changes



Any ideas @rastigo

XXZOMBIEPIKACHU WAS HERE
The Following User Says Thank You to XxZombiePikachu For This Useful Post: [ View ]
6th September 2014, 02:32 PM |#6  
rastigo's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 1,138
 
More
Share your strings.xml and statusbar.xml i will look and revert
Last edited by rastigo; 6th September 2014 at 02:36 PM.
The Following 2 Users Say Thank You to rastigo For This Useful Post: [ View ]
6th September 2014, 03:13 PM |#7  
XxZombiePikachu's Avatar
Recognized Contributor
Flag Florida
Thanks Meter: 1,555
 
More
Quote:
Originally Posted by rastigo

Share your strings.xml and statusbar.xml i will look and revert

It's okay I figured out what I was doing wrong, I was using textclock styles but had forgotten to install modded systemui with the strings for textclock added



XXZOMBIEPIKACHU WAS HERE
The Following 2 Users Say Thank You to XxZombiePikachu For This Useful Post: [ View ]
6th September 2014, 03:49 PM |#8  
rastigo's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 1,138
 
More
Yeah, possibilities are endless
Attached Images
File Type: jpg 1410014953685.jpg - [Click for QR Code] (47.7 KB, 319 views)
The Following 3 Users Say Thank You to rastigo For This Useful Post: [ View ]
7th September 2014, 05:01 PM |#9  
XxZombiePikachu's Avatar
Recognized Contributor
Flag Florida
Thanks Meter: 1,555
 
More
Quote:
Originally Posted by rastigo

Yeah, possibilities are endless

so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?
The Following User Says Thank You to XxZombiePikachu For This Useful Post: [ View ]
7th September 2014, 05:10 PM |#10  
rastigo's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 1,138
 
More
Quote:
Originally Posted by XxZombiePikachu

so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?

You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless
Last edited by rastigo; 7th September 2014 at 05:53 PM.
The Following 2 Users Say Thank You to rastigo For This Useful Post: [ View ]
7th September 2014, 06:53 PM |#11  
XxZombiePikachu's Avatar
Recognized Contributor
Flag Florida
Thanks Meter: 1,555
 
More
Quote:
Originally Posted by rastigo

You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless

Well I left the center clock and added a clock(same code as center one) to the left with visibility gone and textclock and then used the format EEE, MMM/dd/yy but it still includes the clock


XXZOMBIEPIKACHU WAS HERE
The Following User Says Thank You to XxZombiePikachu For This Useful Post: [ View ]

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes