Update lockscreen to use config_headlineFontFamilyLight

Allows OEMs to update the font family that's used for various places in
lockscreen (clock, num pad, and PIN password text). Also updates the
various text sizes to new numbers.

Fixes: 62411304
Fixes: 62411119
Test: ag/2430512 and manual verification
Change-Id: I3ecd1b18bbefe61c6a9cc5f549966ecd71858c9c
This commit is contained in:
Andrew Sapperstein
2017-06-13 18:36:28 -07:00
parent ae448fbf5f
commit fec8092b21
8 changed files with 14 additions and 7 deletions

View File

@@ -2968,6 +2968,8 @@
<!-- Name of a font family to use for headlines. If empty, falls back to platform default -->
<string name="config_headlineFontFamily" translatable="false"></string>
<!-- Name of a font family to use for headlines. Defaults to sans-serif-light -->
<string name="config_headlineFontFamilyLight" translatable="false">sans-serif-light</string>
<!-- An array of packages that need to be treated as type system in battery settings -->
<string-array translatable="false" name="config_batteryPackageTypeSystem">

View File

@@ -3041,6 +3041,7 @@
<java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" />
<java-symbol type="integer" name="config_storageManagerDaystoRetainDefault" />
<java-symbol type="string" name="config_headlineFontFamily" />
<java-symbol type="string" name="config_headlineFontFamilyLight" />
<java-symbol type="drawable" name="stat_sys_vitals" />

View File

@@ -53,7 +53,7 @@
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="28"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
android:textColor="?attr/bgProtectTextColor"
android:contentDescription="@string/keyguard_accessibility_pin_area"
/>

View File

@@ -66,7 +66,7 @@
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="28"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
android:textColor="?attr/bgProtectTextColor"
android:contentDescription="@string/keyguard_accessibility_sim_pin_area"
/>

View File

@@ -67,7 +67,7 @@
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="28"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
android:textColor="?attr/bgProtectTextColor"
android:contentDescription="@string/keyguard_accessibility_sim_puk_area"
/>

View File

@@ -48,6 +48,8 @@
<!-- The size of the dots in the PIN unlock method. -->
<dimen name="password_dot_size">9dp</dimen>
<!-- The size of PIN text in the PIN unlock method. -->
<integer name="scaled_password_text_size">40</integer>
<!-- The padding between chars of the password view. -->
<dimen name="password_char_padding">8dp</dimen>

View File

@@ -32,8 +32,8 @@
<item name="android:singleLine">true</item>
<item name="android:gravity">center_horizontal|center_vertical</item>
<item name="android:background">@null</item>
<item name="android:textSize">36sp</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textSize">32sp</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamilyLight</item>
<item name="android:textColor">?attr/bgProtectTextColor</item>
<item name="android:paddingBottom">-16dp</item>
</style>
@@ -53,7 +53,7 @@
</style>
<style name="widget_big_thin">
<item name="android:textSize">@dimen/widget_big_font_size</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamilyLight</item>
</style>
<style name="BouncerSecurityContainer">

View File

@@ -135,7 +135,9 @@ public class PasswordTextView extends View {
}
mDrawPaint.setFlags(Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
mDrawPaint.setTextAlign(Paint.Align.CENTER);
mDrawPaint.setTypeface(Typeface.create("sans-serif-light", 0));
mDrawPaint.setTypeface(Typeface.create(
context.getString(com.android.internal.R.string.config_headlineFontFamilyLight),
0));
mShowPassword = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.TEXT_SHOW_PASSWORD, 1) == 1;
mAppearInterpolator = AnimationUtils.loadInterpolator(mContext,