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

[GUIDE][05 AUG] How To Make Lock Screen Clock Allign To Center in Jellybean and ICS

OP blindndumb

4th August 2012, 08:25 PM   |  #1  
blindndumb's Avatar
OP Senior Member
Thanks Meter: 4,930
 
1,096 posts
Join Date:Joined: Sep 2011
ABOUT :
This is a easy guide which will teach you how to make the Lockscreen Clock Allign To Center

SCREENSHOT :

Quote:

STEPS :
1. Extract the "framework-res.apk" from ROM
2. Decompile it using apktool
3. Browse To "\res\values" and open dimens.xml
4. Find These Lines
Code:
<dimen name="keyguard_lockscreen_clock_font_size">80.0dip</dimen>
<dimen name="keyguard_lockscreen_status_line_font_size">14.0dip</dimen>
<dimen name="keyguard_lockscreen_status_line_font_right_margin">42.0dip</dimen><dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">22.0dip</dimen>
<dimen name="keyguard_lockscreen_status_line_clockfont_bottom_margin">12.0dip</dimen>
<dimen name="keyguard_lockscreen_pin_margin_left">40.0dip</dimen>
5. You basically need to edit

<dimen name="keyguard_lockscreen_status_line_font_right_m argin">52.0dip</dimen> - Necessary ( Sets Margin from Right which basically alligns to center )
<dimen name="keyguard_lockscreen_clock_font_size">85.0dip </dimen> - Not Necessary ( Sets the font size of clock time display)
<dimen name="keyguard_lockscreen_status_line_clockfont_to p_margin">22.0dip</dimen> - Not Necessary ( Sets Margin From Top )
<dimen name="keyguard_lockscreen_status_line_clockfont_bo ttom_margin">12.0dip</dimen> - Not Necessary ( Sets Margin From Bottom )

6. Assuming that you have a WVGA device. Without a thought do this
Code:
<dimen name="keyguard_lockscreen_status_line_font_right_margin">52.0dip</dimen>
<dimen name="keyguard_lockscreen_clock_font_size">85.0dip</dimen>
What I did is changed the font size to 85 dip and right margin to 52 dip. You can see the result in screenshot above

7. If you have a device with different resolution. You need to do some experiment on your own by changing margin to allign it in center.
I will suggest to keep the right allign to 54-56 dip and font size 82 dip for devices with higher resolution above 480*800

8. Thats All.. If you want too change layout to bottom or extreme top..Change te dip values for top and bottom margin

For more tutorials and guides visit - www.blindndumb.com
Cheers
Last edited by blindndumb; 4th August 2012 at 08:28 PM.
The Following 28 Users Say Thank You to blindndumb For This Useful Post: [ View ]
13th August 2012, 03:48 PM   |  #2  
117micc's Avatar
Senior Member
Thanks Meter: 122
 
490 posts
Join Date:Joined: Apr 2009
Donate to Me
More
anyway you could make this into a flashable zip?
The Following User Says Thank You to 117micc For This Useful Post: [ View ]
13th August 2012, 04:36 PM   |  #3  
Magnumutz's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 127
 
1,042 posts
Join Date:Joined: Jun 2010
Donate to Me
More
I keep getting this error:
Quote:

C:\Users\Magnumutz>apktool b C:\Windows\apk C:\Windows\apk\framework-res.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Windows\apk\res/anim-sw720dp
invalid resource directory name: C:\Windows\apk\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\Windows\apk\res/drawable-sw600dp-nodpi
invalid resource directory name: C:\Windows\apk\res/drawable-sw720dp-nodpi
invalid resource directory name: C:\Windows\apk\res/layout-sw600dp
invalid resource directory name: C:\Windows\apk\res/layout-sw720dp
invalid resource directory name: C:\Windows\apk\res/layout-w600dp
invalid resource directory name: C:\Windows\apk\res/values-h720dp
invalid resource directory name: C:\Windows\apk\res/values-sw600dp
invalid resource directory name: C:\Windows\apk\res/values-sw600dp-land
invalid resource directory name: C:\Windows\apk\res/values-sw600dp-w960dp
invalid resource directory name: C:\Windows\apk\res/values-sw720dp
invalid resource directory name: C:\Windows\apk\res/values-sw720dp-land
invalid resource directory name: C:\Windows\apk\res/values-sw720dp-port
invalid resource directory name: C:\Windows\apk\res/values-sw720dp-w1280dp
invalid resource directory name: C:\Windows\apk\res/values-w360dp
invalid resource directory name: C:\Windows\apk\res/values-w480dp
invalid resource directory name: C:\Windows\apk\res/values-w500dp
invalid resource directory name: C:\Windows\apk\res/values-w600dp
invalid resource directory name: C:\Windows\apk\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\MAGNUM~1\AppData\Local\Tem
p\APKTOOL5388391243637841959.tmp, -x, -S, C:\Windows\apk\res, -M, C:\Windows\apk
\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:301)
at brut.androlib.Androlib.buildResources(Androlib.jav a:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\MAGNUM~1\AppData\Local\Temp\APKTOOL5388391243 637841959.tmp, -x, -S, C:\Wind
ows\apk\res, -M, C:\Windows\apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:191)
... 6 more

The framework-res.apk was decompiled in C:\Windows\apk folder.
What am I doing wrong here?
13th August 2012, 04:54 PM   |  #4  
cakebomb's Avatar
Senior Member
Flag Viersen
Thanks Meter: 474
 
259 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Quote:
Originally Posted by Magnumutz

I keep getting this error:

The framework-res.apk was decompiled in C:\Windows\apk folder.
What am I doing wrong here?

Try to decompile and compile without changing anything. If the error appears again, you're using a false apktool version.
Or have you installed the framework with 'if framework-res.apk'?
13th August 2012, 04:56 PM   |  #5  
IAmAN00bie's Avatar
Senior Member
Thanks Meter: 344
 
619 posts
Join Date:Joined: Dec 2010
More
Hi, is there any way to center the lockscreen ring itself when at a lower DPI? I still haven't found any solution to this...
13th August 2012, 04:58 PM   |  #6  
dstruct2k's Avatar
Senior Member
Flag Winnipeg
Thanks Meter: 895
 
1,206 posts
Join Date:Joined: Jan 2008
Donate to Me
More
Quote:
Originally Posted by Magnumutz

I keep getting this error:

The framework-res.apk was decompiled in C:\Windows\apk folder.
What am I doing wrong here?

  1. Don't use the Windows folder. Try C:\APK\ instead. The last thing you want to do is mess up Windows because you're dumping 100s of files into system folders.
  2. If you're not using a folder under \Users\*USERNAME*\, you'll probably need to run apktool as an admin.
13th August 2012, 06:01 PM   |  #7  
Ichigo's Avatar
Senior Member
Flag Nowhere
Thanks Meter: 960
 
10,042 posts
Join Date:Joined: May 2012
Can I add this to my guide on theming the lock screen?
13th August 2012, 06:56 PM   |  #8  
djkmito's Avatar
Member
Flag Levoča
Thanks Meter: 9
 
69 posts
Join Date:Joined: Jan 2007
More
I haven't "values" folder in framework-res.apk@res/
13th August 2012, 07:10 PM   |  #9  
Magnumutz's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 127
 
1,042 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Quote:
Originally Posted by cakebomb

Try to decompile and compile without changing anything. If the error appears again, you're using a false apktool version.
Or have you installed the framework with 'if framework-res.apk'?

So, i tried decompiling and then compiling without changing anything, the error is still there.
The funny thing is that i downloaded the apktool from their official site on google code.
Quote:
Originally Posted by dstruct2k

  1. Don't use the Windows folder. Try C:\APK\ instead. The last thing you want to do is mess up Windows because you're dumping 100s of files into system folders.
  2. If you're not using a folder under \Users\*USERNAME*\, you'll probably need to run apktool as an admin.

Ok, i moved it to \users\magnumutz and it's still showing me the same error.
13th August 2012, 10:19 PM   |  #10  
icke's Avatar
Senior Member
Flag Ahaus
Thanks Meter: 1,092
 
1,755 posts
Join Date:Joined: Feb 2007
Donate to Me
More
Was playing a lil' bit with your values and have to say for HOX best setting is:

Code:
<dimen name="keyguard_lockscreen_status_line_font_right_m argin">66.0dip</dimen>
to center clock on JB@HTC One X.
Maybe U add this value in OP for XDPI devices.
Thank U for your work!
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-08-13-22-08-30.jpg
Views:	1081
Size:	13.7 KB
ID:	1259289  

Post Reply Subscribe to Thread

Tags
allign, center, guide, lockscreen, www.blindndumb.com
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes