Use config_headlineFontFamily for password screens.

These screens are used whenever setting or confirming the
lockscreen PIN or password. Set them to a consistent textSize (24sp)
and a consistent fontFamily.

Would have set the fontFamily in the style, but unfortunately
setInputType is called on the TextViews after inflation which blows
away the fontFamily. Instead, we set it in code right after that
call.

Change-Id: I77c3f94e2b1ce6d1f19697394c5caa09aac423b0
Fixes: 62873478
Test: manual
This commit is contained in:
Andrew Sapperstein
2017-07-06 14:30:28 -07:00
parent 24ba2fbdb9
commit ccbb4cfc2c
7 changed files with 11 additions and 4 deletions

View File

@@ -76,7 +76,6 @@
android:inputType="textPassword"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:gravity="center"
android:textSize="16sp"
style="@style/TextAppearance.PasswordEntry"/>
<TextView style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"

View File

@@ -59,7 +59,6 @@
android:gravity="center"
android:inputType="textPassword"
android:imeOptions="actionNext|flagNoExtractUi|flagForceAscii"
android:textSize="24sp"
style="@style/TextAppearance.PasswordEntry"/>
<android.support.v7.widget.RecyclerView

View File

@@ -76,7 +76,6 @@
android:inputType="textPassword"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:gravity="center"
android:textSize="16sp"
style="@style/TextAppearance.PasswordEntry"/>
<TextView

View File

@@ -54,7 +54,6 @@
android:inputType="textPassword"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:gravity="center"
android:textSize="16sp"
style="@style/TextAppearance.PasswordEntry"/>
<TextView

View File

@@ -79,6 +79,7 @@
<item name="android:gravity">center</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">24sp</item>
</style>
<style name="TextAppearance.CryptKeeper_PasswordEntry" parent="android:TextAppearance.Material">

View File

@@ -30,6 +30,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources.Theme;
import android.graphics.Insets;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -375,6 +376,10 @@ public class ChooseLockPassword extends SettingsActivity {
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(mIsAlphaMode ? currentType
: (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
// Can't set via XML since setInputType resets the fontFamily to null
mPasswordEntry.setTypeface(Typeface.create(
getContext().getString(com.android.internal.R.string.config_headlineFontFamily),
Typeface.NORMAL));
Intent intent = getActivity().getIntent();
final boolean confirmCredentials = intent.getBooleanExtra(

View File

@@ -20,6 +20,7 @@ import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.CountDownTimer;
@@ -172,6 +173,10 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(mIsAlpha ? currentType
: (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
// Can't set via XML since setInputType resets the fontFamily to null
mPasswordEntry.setTypeface(Typeface.create(
getContext().getString(com.android.internal.R.string.config_headlineFontFamily),
Typeface.NORMAL));
mAppearAnimationUtils = new AppearAnimationUtils(getContext(),
220, 2f /* translationScale */, 1f /* delayScale*/,
AnimationUtils.loadInterpolator(getContext(),