Skip to content

Commit

Permalink
SystemUI: Match lockscreen clock font with system
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Vashi <[email protected]>
Signed-off-by: DennySPb <[email protected]>
  • Loading branch information
neobuddy89 authored and DennySPB committed Dec 19, 2022
1 parent 1078567 commit 366b3c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package com.android.systemui.shared.clocks
import android.content.Context
import android.content.res.Resources
import android.graphics.Color
import android.graphics.Typeface
import android.graphics.drawable.Drawable
import android.icu.text.NumberFormat
import android.util.TypedValue
Expand Down Expand Up @@ -135,10 +136,18 @@ class DefaultClock(
clocks.forEach { it.onTimeZoneChanged(timeZone) }

override fun onFontSettingChanged() {
smallClock.setTypeface(
Typeface.create(
resources.getString(com.android.internal.R.string.config_headlineFontFamily), Typeface.NORMAL)
)
smallClock.setTextSize(
TypedValue.COMPLEX_UNIT_PX,
resources.getDimensionPixelSize(R.dimen.small_clock_text_size).toFloat()
)
largeClock.setTypeface(
Typeface.create(
resources.getString(com.android.internal.R.string.config_headlineFontFamily), Typeface.NORMAL)
)
largeClock.setTextSize(
TypedValue.COMPLEX_UNIT_PX,
resources.getDimensionPixelSize(R.dimen.large_clock_text_size).toFloat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ public void onLocaleListChanged() {
public void onDensityOrFontScaleChanged() {
mKeyguardClockSwitchController.onDensityOrFontScaleChanged();
}

@Override
public void onThemeChanged() {
mKeyguardClockSwitchController.onDensityOrFontScaleChanged();
}
};

private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
Expand Down

0 comments on commit 366b3c9

Please sign in to comment.