Search in sources :

Example 1 with PREF_BOOLEAN_ENABLE_CONFIRMATION_CHALLENGES

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();
}
Also used : Context(android.content.Context) LinearLayout(android.widget.LinearLayout) PREF_BOOLEAN_CONFIRMATION_USE_FINGERPRINT(sugar.free.sightremote.utils.Preferences.PREF_BOOLEAN_CONFIRMATION_USE_FINGERPRINT) Spanned(android.text.Spanned) PackageManager(android.content.pm.PackageManager) RequiresApi(android.support.annotation.RequiresApi) Preferences.getStringPref(sugar.free.sightremote.utils.Preferences.getStringPref) Editable(android.text.Editable) ArrayList(java.util.ArrayList) Manifest(android.Manifest) SuppressLint(android.annotation.SuppressLint) Handler(android.os.Handler) Looper(android.os.Looper) View(android.view.View) Button(android.widget.Button) PREF_STRING_CONFIRMATION_PIN(sugar.free.sightremote.utils.Preferences.PREF_STRING_CONFIRMATION_PIN) Preferences.getBooleanPref(sugar.free.sightremote.utils.Preferences.getBooleanPref) Build(android.os.Build) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) CancellationSignal(android.os.CancellationSignal) ContextCompat(android.support.v4.content.ContextCompat) HTMLUtil(sugar.free.sightremote.utils.HTMLUtil) PREF_BOOLEAN_ENABLE_CONFIRMATION_CHALLENGES(sugar.free.sightremote.utils.Preferences.PREF_BOOLEAN_ENABLE_CONFIRMATION_CHALLENGES) FingerprintManager(android.hardware.fingerprint.FingerprintManager) PREF_BOOLEAN_CONFIRMATION_USE_PIN(sugar.free.sightremote.utils.Preferences.PREF_BOOLEAN_CONFIRMATION_USE_PIN) PorterDuff(android.graphics.PorterDuff) List(java.util.List) R(sugar.free.sightremote.R) AlertDialog(android.support.v7.app.AlertDialog) TextView(android.widget.TextView) Vibrator(android.os.Vibrator) SightRemote(sugar.free.sightremote.SightRemote) Collections(java.util.Collections) TextWatcher(android.text.TextWatcher) CancellationSignal(android.os.CancellationSignal) SuppressLint(android.annotation.SuppressLint)

Aggregations

Manifest (android.Manifest)1 SuppressLint (android.annotation.SuppressLint)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 PackageManager (android.content.pm.PackageManager)1 PorterDuff (android.graphics.PorterDuff)1 FingerprintManager (android.hardware.fingerprint.FingerprintManager)1 Build (android.os.Build)1 CancellationSignal (android.os.CancellationSignal)1 Handler (android.os.Handler)1 Looper (android.os.Looper)1 Vibrator (android.os.Vibrator)1 RequiresApi (android.support.annotation.RequiresApi)1 ContextCompat (android.support.v4.content.ContextCompat)1 AlertDialog (android.support.v7.app.AlertDialog)1 Editable (android.text.Editable)1 Spanned (android.text.Spanned)1 TextWatcher (android.text.TextWatcher)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1