Change lockscreen time and date font?


Question

Starting from Android 6.0, Google altered how their lockscreen looks in AOSP, presumably to increase readability:




  • Digital clock is smaller

  • Digital clock uses a bolder font, presumably Roboto Medium

  • Date text is ALL CAPS

  • Date text has a noticeable character spacing



A comparison can be seen in the pic below.



enter image description here



It seems that this is Google's design vision going forward, as Android 7.x only kept or reinforced upon those points, and the recently released Fuchsia OS preview is in the same style.



However, as good as Google's intention might be, I'm not a fan of all these points above, and now that I see Google is determined to push it (Fuchsia), I'm determined to revert it back to what it was in Android 5.x. I'm rooted, have a custom recovery, and know how to decompile and recompile APKs, so I should be ready for whatever's needed.



Ideas?


Answer

After some more searching, I finally came across an XDA-Developers thread explaining how to do it - or rather, how to do the reverse action of what I want to achieve (credits to the original author there). I'll post an excerpt of the core part and reverse the action yet again to make it fit my purpose.





  1. Install apktool.

  2. Install your framework-res.apk by executing apktool if /path/to/framework-res.apk.

  3. Decompile your SystemUI.apk by executing apktool d /path/to/SystemUI.apk

  4. Go to the decompiled SystemUI folder and open res/values/styles.xml.

  5. Search for big_thin and replace sans-serif-light behind <item name="android:fontFamily"> with sans-serif-thin.

  6. Open res/values/dimens.xml.

  7. Search for widget_label_font_size and replace 14.0sp behind it with 16.0sp.

  8. Open res/layout/keyguard_status_area.xml.

  9. In the two lines starting with TextClock and TextView, remove android:textAllCaps="true" and android:letterSpacing="0.15".

  10. Rebuild SystemUI (preserve its signature) by executing apktool b -c SystemUI.

  11. Push the finished SystemUI.apk back to where it was using a method of your choice, set correct permissions, then reboot.




The end result is pictured below. Font size might still use some tweaks, but generally favorable result.





P.S.1: For the record, and for ROM makers who are interested: you can also modify the same files prior to building the ROM - find the files above in *build-folder*/frameworks/base/packages/Keyguard/.



P.S.2: Interestingly, while searching for "reverting the font on 6.0+ back to what it was in 5.x" didn't return anything, searching for "changing the font on 5.x so it looks like 6.0+" (the opposite) did return more favorable results, as there were quite a number of Marshmallow wannabes back then. I guess that's a lesson learned in Google-fu...


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes