Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,079 Members 50,605 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
blindndumb
Old
(Last edited by blindndumb; 4th August 2012 at 07:28 PM.)
#1  
blindndumb's Avatar
Senior Member - OP
Thanks Meter 4,923
Posts: 1,096
Join Date: Sep 2011
Tutorial [GUIDE][05 AUG] How To Make Lock Screen Clock Allign To Center in Jellybean and ICS

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
Like my work? Consider donating via PayPal
Check out my android apps on PlayStore!
Follow me on Twitter / Google +
The Following 28 Users Say Thank You to blindndumb For This Useful Post: [ Click to Expand ]
 
117micc
Old
#2  
117micc's Avatar
Senior Member
Thanks Meter 107
Posts: 423
Join Date: Apr 2009

 
DONATE TO ME
anyway you could make this into a flashable zip?
Alive and kickin'

Device: Samsung Galaxy Note 3 ROOTED!!!
Recovery: SafeStrap
Rom: Beans
Kernel: STOCK
Android: Jelly bean 4.3


DEAD

Device: Samsung Galaxy NOTE 2 ROOTED!!!!
Recovery: TWRP
Rom: CM10 Kanged!!!
Kernel: ^^^^^^^^^^^^^^^
Android: Jelly bean
"died falling in between my car door as I shut it, shattered screen :/"
The Following User Says Thank You to 117micc For This Useful Post: [ Click to Expand ]
 
Magnumutz
Old
#3  
Magnumutz's Avatar
Senior Member
Thanks Meter 127
Posts: 1,033
Join Date: Jun 2010
Location: Bucharest

 
DONATE TO ME
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?
 
cakebomb
Old
#4  
cakebomb's Avatar
Senior Member
Thanks Meter 473
Posts: 259
Join Date: Nov 2011
Location: Viersen

 
DONATE TO ME
Quote:
Originally Posted by Magnumutz View Post
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'?
 
IAmAN00bie
Old
#5  
IAmAN00bie's Avatar
Senior Member
Thanks Meter 342
Posts: 619
Join Date: Dec 2010
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...
Device: Google Nexus 5
ROM: Paranoid Android
Kernel: Trinity Kernel

XDA Tribute: http://www.youtube.com/watch?v=gLK5CwVVEiA
 
dstruct2k
Old
#6  
dstruct2k's Avatar
Senior Member
Thanks Meter 887
Posts: 1,198
Join Date: Jan 2008
Location: Winnipeg

 
DONATE TO ME
Quote:
Originally Posted by Magnumutz View Post
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.
Samsung Galaxy S5 16GB - G900W8 - ROM: ....

NOTE: I am no longer maintaining the I747 threads, as I have moved on to another device.
I747 Owners: Install a custom recovery! | Try different modem firmware! | Update your bootloader!
Reddit XDA Steam Facebook YouTube Github Google+
 
Gohan
Old
#7  
Gohan's Avatar
Senior Member
Thanks Meter 959
Posts: 9,990
Join Date: May 2012
Location: Nowhere
Can I add this to my guide on theming the lock screen?
 
djkmito
Old
#8  
djkmito's Avatar
Member
Thanks Meter 8
Posts: 67
Join Date: Jan 2007
Location: Levoča
I haven't "values" folder in framework-res.apk@res/
My device is Motorola Atrix
 
Magnumutz
Old
#9  
Magnumutz's Avatar
Senior Member
Thanks Meter 127
Posts: 1,033
Join Date: Jun 2010
Location: Bucharest

 
DONATE TO ME
Quote:
Originally Posted by cakebomb View Post
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 View Post
  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.
 
icke
Old
#10  
icke's Avatar
Senior Member
Thanks Meter 1,092
Posts: 1,755
Join Date: Feb 2007
Location: Ahaus

 
DONATE TO ME
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:	1062
Size:	13.7 KB
ID:	1259289  

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

Advanced Search
Display Modes