Search code examples
androidlayoutclocklockscreen

AOSP: where can I find the layout of the new clock (fonts and size)?


As the new clock layout in Android 4.2 is awesome, I would like to use it as a basis for my apps.

Thanks to the beauty of Open Source, the source code is available, but I have been browsing it for hours and never found it.

I know posting no code on StackOverflow is not cool, but I strongly believe that sharing this info might be usefull for other developers.

enter image description here


Solution

  • Not sure if that's it but have a look at

    https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/keyguard_screen_tab_unlock.xml

    Should be some keyguard_* layout and the source for the digital clock widget would be

    https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/widget/DigitalClock.java

    Edit: github seems to be outdated, the following ones should be more accurate

    https://android.googlesource.com/platform/frameworks/base/+/android-4.2_r1/core/res/res/layout/keyguard_screen_tab_unlock.xml

    https://android.googlesource.com/platform/frameworks/base/+/android-4.2_r1/core/java/com/android/internal/widget/DigitalClock.java