From fa799a9081aa0912598a3a88f13ca456964bf718 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Fri, 22 Oct 2021 17:32:00 -0700 Subject: SystemUI: Update keyguard clock metrics for Inter font Font metrics are used to calculate the big keyguard clock's pivot point. Update the metrics to match our clock font, Inter, in order to fix clock misalignment as compared to using Roboto's metrics for Inter. New metrics, mostly from the Inter readme [1]: - UPM = 2816 - Cap height = 2048 - Total height = 3072 (from ttx-decompiled yMax) [1] https://github.com/rsms/inter#design Change-Id: I88129acf00dac487a111cd0b71871838dc3e9c93 --- .../systemui/statusbar/phone/NotificationPanelViewController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 11a0c7e93488..3c7389ad0c0b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -264,10 +264,10 @@ public class NotificationPanelViewController extends PanelViewController { private final NotificationStackScrollLayoutController mNotificationStackScrollLayoutController; private final NotificationIconAreaController mNotificationIconAreaController; - // Cap and total height of Roboto font. Needs to be adjusted when font for the big clock is + // Cap and total height of Inter font. Needs to be adjusted when font for the big clock is // changed. - private static final int CAP_HEIGHT = 1456; - private static final int FONT_HEIGHT = 2163; + private static final int CAP_HEIGHT = 2048; + private static final int FONT_HEIGHT = 3072; /** * Maximum time before which we will expand the panel even for slow motions when getting a @@ -4640,7 +4640,7 @@ public class NotificationPanelViewController extends PanelViewController { // Update Clock Pivot mKeyguardStatusViewController.setPivotX(mView.getWidth() / 2); mKeyguardStatusViewController.setPivotY( - (FONT_HEIGHT - CAP_HEIGHT) / 2048f + (FONT_HEIGHT - CAP_HEIGHT) / 2816f * mKeyguardStatusViewController.getClockTextSize()); // Calculate quick setting heights. -- cgit v1.2.3