Esempio n. 1
0
 public void AgainAuthentication()
 {
     OnCreate(null);
     _dialogFrag = FingerprintManagerApiDialogFragment.NewInstance(_fingerprintManager);
     _initialPanel.Visibility        = ViewStates.Visible;
     _authenticatedPanel.Visibility  = ViewStates.Gone;
     _errorPanel.Visibility          = ViewStates.Gone;
     _scanInProgressPanel.Visibility = ViewStates.Gone;
 }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_fingerprintmanager_api);

            InitializeViewReferences();

            _fingerprintManager = FingerprintManagerCompat.From(this);
            string canScanMsg = CheckFingerprintEligibility();

            _startAuthenticationScanButton.Click += StartFingerprintScan;
            _scanAgainButton.Click       += ScanAgainButtonOnClick;
            _failedScanAgainButton.Click += RecheckEligibility;

            if (_canScan)
            {
                _dialogFrag = FingerprintManagerApiDialogFragment.NewInstance(_fingerprintManager);
            }
            else
            {
                Toast.MakeText(this, "No se puede utilizar escaneo de huella dactilar en el dispositivo. " + canScanMsg, ToastLength.Long).Show();
                OnBackPressed();
                return;
            }
            Permission permissionResult = ContextCompat.CheckSelfPermission(this,
                                                                            Manifest.Permission.UseFingerprint);

            if (permissionResult == Permission.Granted)
            {
                _initialPanel.Visibility        = ViewStates.Gone;
                _authenticatedPanel.Visibility  = ViewStates.Gone;
                _errorPanel.Visibility          = ViewStates.Gone;
                _scanInProgressPanel.Visibility = ViewStates.Visible;
                _dialogFrag.Init();
                _dialogFrag.Show(FragmentManager, DIALOG_FRAGMENT_TAG);
            }
            else
            {
                Snackbar.Make(FindViewById(Res.Id.Content),
                              Resource.String.missing_fingerprint_permissions,
                              Snackbar.LengthLong)
                .Show();
            }
        }
Esempio n. 3
0
        public void RecheckEligibility(object sender, EventArgs eventArgs)
        {
            string canScanMsg = CheckFingerprintEligibility();

            if (_canScan)
            {
                _dialogFrag = FingerprintManagerApiDialogFragment.NewInstance(_fingerprintManager);
                _initialPanel.Visibility        = ViewStates.Visible;
                _authenticatedPanel.Visibility  = ViewStates.Gone;
                _errorPanel.Visibility          = ViewStates.Gone;
                _scanInProgressPanel.Visibility = ViewStates.Gone;
            }
            else
            {
                Log.Debug(TAG, "This device is still ineligiblity for fingerprint authentication. ");
                _dialogFrag = null;
                ShowError("Can't use this device for the sample.", canScanMsg);
            }
        }