@ -73,7 +73,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
private View passphraseAuthContainer ;
private View passphraseAuthContainer ;
private ImageView fingerprintPrompt ;
private ImageView fingerprintPrompt ;
private TextView lockScreenButton ;
private TextView lockScreenButton ;
private TextView fingerprintStatusText ;
private EditText passphraseText ;
private EditText passphraseText ;
private ImageButton showButton ;
private ImageButton showButton ;
@ -106,9 +105,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
dynamicTheme . onResume ( this ) ;
dynamicTheme . onResume ( this ) ;
dynamicLanguage . onResume ( this ) ;
dynamicLanguage . onResume ( this ) ;
fingerprintStatusText . setText ( getResources ( ) . getString ( R . string . PassphrasePromptActivity_touch_sensor ) ) ;
fingerprintStatusText . setTextColor ( getResources ( ) . getColor ( R . color . gray27 ) ) ;
setLockTypeVisibility ( ) ;
setLockTypeVisibility ( ) ;
if ( TextSecurePreferences . isScreenLockEnabled ( this ) & & ! authenticated & & ! failure ) {
if ( TextSecurePreferences . isScreenLockEnabled ( this ) & & ! authenticated & & ! failure ) {
@ -218,7 +214,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
passphraseAuthContainer = findViewById ( R . id . password_auth_container ) ;
passphraseAuthContainer = findViewById ( R . id . password_auth_container ) ;
fingerprintPrompt = findViewById ( R . id . fingerprint_auth_container ) ;
fingerprintPrompt = findViewById ( R . id . fingerprint_auth_container ) ;
lockScreenButton = findViewById ( R . id . lock_screen_auth_container ) ;
lockScreenButton = findViewById ( R . id . lock_screen_auth_container ) ;
fingerprintStatusText = findViewById ( R . id . fingerprint_status_text ) ;
fingerprintManager = FingerprintManagerCompat . from ( this ) ;
fingerprintManager = FingerprintManagerCompat . from ( this ) ;
fingerprintCancellationSignal = new CancellationSignal ( ) ;
fingerprintCancellationSignal = new CancellationSignal ( ) ;
fingerprintListener = new FingerprintListener ( ) ;
fingerprintListener = new FingerprintListener ( ) ;
@ -345,22 +340,23 @@ public class PassphrasePromptActivity extends PassphraseActivity {
@Override
@Override
public void onAuthenticationError ( int errMsgId , CharSequence errString ) {
public void onAuthenticationError ( int errMsgId , CharSequence errString ) {
Log . w ( TAG , "Authentication error: " + errMsgId + " " + errString ) ;
Log . w ( TAG , "Authentication error: " + errMsgId + " " + errString ) ;
onAuthenticationFailed ( ) ;
}
}
@Override
@Override
public void onAuthenticationSucceeded ( FingerprintManagerCompat . AuthenticationResult result ) {
public void onAuthenticationSucceeded ( FingerprintManagerCompat . AuthenticationResult result ) {
Log . i ( TAG , "onAuthenticationSucceeded" ) ;
Log . i ( TAG , "onAuthenticationSucceeded" ) ;
fingerprintPrompt . setImageResource ( R . drawable . ic_check_white_48dp ) ;
fingerprintPrompt . setImageResource ( R . drawable . ic_check_white_48dp ) ;
fingerprintPrompt . getBackground ( ) . setColorFilter ( getResources ( ) . getColor ( R . color . teal _500) , PorterDuff . Mode . SRC_IN ) ;
fingerprintPrompt . getBackground ( ) . setColorFilter ( getResources ( ) . getColor ( R . color . green _500) , PorterDuff . Mode . SRC_IN ) ;
fingerprintPrompt . animate ( ) . setInterpolator ( new BounceInterpolator ( ) ) . scaleX ( 1.1f ) . scaleY ( 1.1f ) . setDuration ( 500 ) . setListener ( new AnimationCompleteListener ( ) {
fingerprintPrompt . animate ( ) . setInterpolator ( new BounceInterpolator ( ) ) . scaleX ( 1.1f ) . scaleY ( 1.1f ) . setDuration ( 500 ) . setListener ( new AnimationCompleteListener ( ) {
@Override
@Override
public void onAnimationEnd ( Animator animation ) {
public void onAnimationEnd ( Animator animation ) {
handleAuthenticated ( ) ;
handleAuthenticated ( ) ;
fingerprintPrompt . setImageResource ( R . drawable . ic_fingerprint_white_48dp ) ;
fingerprintPrompt . getBackground ( ) . setColorFilter ( getResources ( ) . getColor ( R . color . signal_primary ) , PorterDuff . Mode . SRC_IN ) ;
}
}
} ) . start ( ) ;
} ) . start ( ) ;
fingerprintStatusText . setText ( getResources ( ) . getString ( R . string . PassphrasePromptActivity_fingerprint_recognized ) ) ;
fingerprintStatusText . setTextColor ( getResources ( ) . getColor ( R . color . teal_500 ) ) ;
}
}
@Override
@Override
@ -368,12 +364,12 @@ public class PassphrasePromptActivity extends PassphraseActivity {
Log . w ( TAG , "onAuthenticatoinFailed()" ) ;
Log . w ( TAG , "onAuthenticatoinFailed()" ) ;
FingerprintManagerCompat . AuthenticationCallback callback = this ;
FingerprintManagerCompat . AuthenticationCallback callback = this ;
fingerprintPrompt . setImageResource ( R . drawable . ic_ priority_high _white_48dp) ;
fingerprintPrompt . setImageResource ( R . drawable . ic_ close _white_48dp) ;
fingerprintPrompt . getBackground ( ) . setColorFilter ( getResources ( ) . getColor ( R . color . deep_orange_6 00) , PorterDuff . Mode . SRC_IN ) ;
fingerprintPrompt . getBackground ( ) . setColorFilter ( getResources ( ) . getColor ( R . color . red_5 00) , PorterDuff . Mode . SRC_IN ) ;
TranslateAnimation shake = new TranslateAnimation ( 0 , 2 0, 0 , 0 ) ;
TranslateAnimation shake = new TranslateAnimation ( 0 , 3 0, 0 , 0 ) ;
shake . setDuration ( 50 ) ;
shake . setDuration ( 50 ) ;
shake . setRepeatCount ( 5 ) ;
shake . setRepeatCount ( 7 ) ;
shake . setAnimationListener ( new Animation . AnimationListener ( ) {
shake . setAnimationListener ( new Animation . AnimationListener ( ) {
@Override
@Override
public void onAnimationStart ( Animation animation ) { }
public void onAnimationStart ( Animation animation ) { }
@ -389,9 +385,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
} ) ;
} ) ;
fingerprintPrompt . startAnimation ( shake ) ;
fingerprintPrompt . startAnimation ( shake ) ;
fingerprintStatusText . setText ( getResources ( ) . getString ( R . string . PassphrasePromptActivity_fingerprint_not_recognized_try_again ) ) ;
fingerprintStatusText . setTextColor ( getResources ( ) . getColor ( R . color . deep_orange_600 ) ) ;
}
}
}
}