use of sugar.free.sightremote.utils.Preferences.PREF_BOOLEAN_ENABLE_CONFIRMATION_CHALLENGES in project SightRemote by TebbeUbben.
the class ConfirmationDialog method show.
@SuppressLint("NewApi")
public void show() {
prepareViews();
dialog = builder.show();
dialog.setOnDismissListener((dialogInterface -> onClose()));
dialog.setOnCancelListener((dialog -> onClose()));
if (useFingerprint())
getFingerprintManager().authenticate(null, cancellationSignal = new CancellationSignal(), 0, new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
onConfirm();
}
@Override
public void onAuthenticationFailed() {
fingerprintIcon.getBackground().setColorFilter(ContextCompat.getColor(SightRemote.getInstance(), R.color.colorWrong), PorterDuff.Mode.MULTIPLY);
fingerprintText.setText(R.string.couldnt_recognize_fingerprint);
fingerprintText.setTextColor(ContextCompat.getColor(SightRemote.getInstance(), R.color.colorWrong));
}
}, null);
if (getBooleanPref(PREF_BOOLEAN_ENABLE_CONFIRMATION_CHALLENGES))
pin.requestFocus();
}
Aggregations