Fix fingerprint dialog color contrast for dark theme
The code to set the color of the help text shown on the fingerprint dialog does not currently check the context theme. This means that the wrong color is used when the system is using a dark theme. This commit fixes the issue by ensuring the appropriate themed color is used. It also increases the contrast of the dark theme color so that the text is more visible against the dialog background. Test: Set system theme to dark mode and trigger the fingerprint dialog. Bug: 174831630 Change-Id: I41dfb536e72063ae8ea84d51fa0e50613f920090
This commit is contained in:
@@ -73,7 +73,7 @@
|
|||||||
<color name="media_divider">#85ffffff</color>
|
<color name="media_divider">#85ffffff</color>
|
||||||
|
|
||||||
<!-- Biometric dialog colors -->
|
<!-- Biometric dialog colors -->
|
||||||
<color name="biometric_dialog_gray">#ff888888</color>
|
<color name="biometric_dialog_gray">#ffcccccc</color>
|
||||||
<color name="biometric_dialog_accent">#ff80cbc4</color> <!-- light teal -->
|
<color name="biometric_dialog_accent">#ff80cbc4</color> <!-- light teal -->
|
||||||
<color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 -->
|
<color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 -->
|
||||||
|
|
||||||
|
|||||||
@@ -160,12 +160,12 @@ public class AuthBiometricFaceView extends AuthBiometricView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleResetAfterError() {
|
protected void handleResetAfterError() {
|
||||||
resetErrorView(mContext, mIndicatorView);
|
resetErrorView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleResetAfterHelp() {
|
protected void handleResetAfterHelp() {
|
||||||
resetErrorView(mContext, mIndicatorView);
|
resetErrorView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -185,7 +185,7 @@ public class AuthBiometricFaceView extends AuthBiometricView {
|
|||||||
|
|
||||||
if (newState == STATE_AUTHENTICATING_ANIMATING_IN ||
|
if (newState == STATE_AUTHENTICATING_ANIMATING_IN ||
|
||||||
(newState == STATE_AUTHENTICATING && getSize() == AuthDialog.SIZE_MEDIUM)) {
|
(newState == STATE_AUTHENTICATING && getSize() == AuthDialog.SIZE_MEDIUM)) {
|
||||||
resetErrorView(mContext, mIndicatorView);
|
resetErrorView();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do this last since the state variable gets updated.
|
// Do this last since the state variable gets updated.
|
||||||
@@ -204,9 +204,8 @@ public class AuthBiometricFaceView extends AuthBiometricView {
|
|||||||
super.onAuthenticationFailed(failureReason);
|
super.onAuthenticationFailed(failureReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resetErrorView(Context context, TextView textView) {
|
private void resetErrorView() {
|
||||||
textView.setTextColor(context.getResources().getColor(
|
mIndicatorView.setTextColor(mTextColorHint);
|
||||||
R.color.biometric_dialog_gray, context.getTheme()));
|
mIndicatorView.setVisibility(View.INVISIBLE);
|
||||||
textView.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class AuthBiometricFingerprintView extends AuthBiometricView {
|
|||||||
|
|
||||||
private void showTouchSensorString() {
|
private void showTouchSensorString() {
|
||||||
mIndicatorView.setText(R.string.fingerprint_dialog_touch_sensor);
|
mIndicatorView.setText(R.string.fingerprint_dialog_touch_sensor);
|
||||||
mIndicatorView.setTextColor(R.color.biometric_dialog_gray);
|
mIndicatorView.setTextColor(mTextColorHint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateIcon(int lastState, int newState) {
|
private void updateIcon(int lastState, int newState) {
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ public abstract class AuthBiometricView extends LinearLayout {
|
|||||||
private final Injector mInjector;
|
private final Injector mInjector;
|
||||||
private final Handler mHandler;
|
private final Handler mHandler;
|
||||||
private final AccessibilityManager mAccessibilityManager;
|
private final AccessibilityManager mAccessibilityManager;
|
||||||
private final int mTextColorError;
|
protected final int mTextColorError;
|
||||||
private final int mTextColorHint;
|
protected final int mTextColorHint;
|
||||||
|
|
||||||
private AuthPanelController mPanelController;
|
private AuthPanelController mPanelController;
|
||||||
private PromptInfo mPromptInfo;
|
private PromptInfo mPromptInfo;
|
||||||
@@ -183,7 +183,7 @@ public abstract class AuthBiometricView extends LinearLayout {
|
|||||||
private TextView mDescriptionView;
|
private TextView mDescriptionView;
|
||||||
private View mIconHolderView;
|
private View mIconHolderView;
|
||||||
protected ImageView mIconView;
|
protected ImageView mIconView;
|
||||||
@VisibleForTesting protected TextView mIndicatorView;
|
protected TextView mIndicatorView;
|
||||||
|
|
||||||
// Negative button position, exclusively for the app-specified behavior
|
// Negative button position, exclusively for the app-specified behavior
|
||||||
@VisibleForTesting Button mNegativeButton;
|
@VisibleForTesting Button mNegativeButton;
|
||||||
|
|||||||
Reference in New Issue
Block a user