private void cancelIdleWarning() {
   if (mIdleDialogShowing) {
     mIdleDialogFragment.dismiss();
     getFragmentManager().executePendingTransactions();
     mIdleDialogShowing = false;
   }
 }
Example #2
0
  public void OnConnected() {
    if (sampleDialogFragment != null) sampleDialogFragment.dismiss();

    String message = "Device Open Success";
    // tv_Status.setText(message);

  }
Example #3
0
  public void OnDisConnected() {
    NBioBSPJNI.CURRENT_PRODUCT_ID = 0;

    if (sampleDialogFragment != null) sampleDialogFragment.dismiss();

    String message = "NBioBSP Disconnected: " + bsp.GetErrorCode();
    // tv_Status.setText(message);

  }
  // Abort or complete ShutDown based on value of shouldContinue
  private void continueShutdown(boolean shouldContinue) {
    if (shouldContinue) {

      Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.moma.org"));
      startActivity(browserIntent);

    } else {

      // Abort ShutDown and dismiss dialog
      mDialog.dismiss();
    }
  }
Example #5
0
  /**
   * Capture Function
   *
   * @param captured_data
   * @return
   */
  public int OnCaptured(NBioBSPJNI.CAPTURED_DATA captured_data) {
    //  tvDevice.setText("IMAGE Quality: "+capturedData.getImageQuality());

    if (captured_data.getImage() != null) {
      if (bCapturedFirst) {
        iv_VerifyFinger.setImageBitmap(captured_data.getImage());
      }
    }

    // quality : 40~100
    if (captured_data.getImageQuality() >= EConstants.QUALITY_LIMIT) {
      if (sampleDialogFragment != null
          && "DIALOG_TYPE_PROGRESS".equals(sampleDialogFragment.getTag()))
        sampleDialogFragment.dismiss();
      return NBioBSPJNI.ERROR.NBioAPIERROR_USER_CANCEL;
    } else if (captured_data.getDeviceError() != NBioBSPJNI.ERROR.NBioAPIERROR_NONE) {
      if (sampleDialogFragment != null
          && "DIALOG_TYPE_PROGRESS".equals(sampleDialogFragment.getTag()))
        sampleDialogFragment.dismiss();
      return captured_data.getDeviceError();
    } else {
      return NBioBSPJNI.ERROR.NBioAPIERROR_NONE;
    }
  }
  @Override
  public void onDialogPositiveClick(DialogFragment dialog) {
    if (identificationMissing) {
      SharedPreferences.Editor editor = preferences.edit();
      editor.putString(
          "identification", ((IdentificationWlanKeyDialogFragment) dialog).getIdentification());
      editor.commit();
    }

    if (wlanKeyMissing) {
      adhoc.connectToNetwork(
          ssid, ((IdentificationWlanKeyDialogFragment) dialog).getWlanKey(), this);
    } else {
      adhoc.connectToNetwork(networkId, this);
    }

    dialog.dismiss();
  }
    public void onEventMainThread(ThrowableFailureEvent event) {
      if (!isInExecutionScope(executionScope, event)) {
        return;
      }
      checkLogException(event);

      // Execute pending commits before finding to avoid multiple error fragments being shown
      android.app.FragmentManager fm = getFragmentManager();
      fm.executePendingTransactions();

      android.app.DialogFragment existingFragment =
          (android.app.DialogFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG);
      if (existingFragment != null) {
        // Just show the latest error
        existingFragment.dismiss();
      }

      android.app.DialogFragment errorFragment =
          (android.app.DialogFragment)
              factory.prepareErrorFragment(event, finishAfterDialog, argumentsForErrorDialog);
      if (errorFragment != null) {
        errorFragment.show(fm, TAG_ERROR_DIALOG);
      }
    }
Example #8
0
 public void onClickStopBtn(DialogFragment dialogFragment) {
   bAutoOn = false;
   sampleDialogFragment.dismiss();
 }
Example #9
0
  public synchronized void OnCapture1(int timeout) {

    NBioBSPJNI.FIR_HANDLE hCapturedFIR, hAuditFIR;
    NBioBSPJNI.CAPTURED_DATA capturedData;

    hCapturedFIR = bsp.new FIR_HANDLE();
    hAuditFIR = bsp.new FIR_HANDLE();
    capturedData = bsp.new CAPTURED_DATA();

    bCapturedFirst = true;

    bsp.Capture(
        NBioBSPJNI.FIR_PURPOSE.ENROLL,
        hCapturedFIR,
        timeout,
        hAuditFIR,
        capturedData,
        MainActivity.this,
        0,
        null);

    if (sampleDialogFragment != null
        && "DIALOG_TYPE_PROGRESS".equals(sampleDialogFragment.getTag()))
      sampleDialogFragment.dismiss();

    if (bsp.IsErrorOccured()) {
      msg = "NBioBSP Capture Error: " + bsp.GetErrorCode();
    } else {
      NBioBSPJNI.INPUT_FIR inputFIR;

      inputFIR = bsp.new INPUT_FIR();

      // Make ISO 19794-2 data
      {
        NBioBSPJNI.Export.DATA exportData;

        inputFIR.SetFIRHandle(hCapturedFIR);

        exportData = exportEngine.new DATA();

        exportEngine.ExportFIR(inputFIR, exportData, NBioBSPJNI.EXPORT_MINCONV_TYPE.OLD_FDA);

        if (bsp.IsErrorOccured()) {
          runOnUiThread(
              new Runnable() {

                public void run() {
                  msg = "NBioBSP ExportFIR Error: " + bsp.GetErrorCode();
                }
              });
          return;
        }

        if (byTemplate1 != null) byTemplate1 = null;

        byTemplate1 = new byte[exportData.FingerData[0].Template[0].Data.length];
        byTemplate1 = exportData.FingerData[0].Template[0].Data;

        Base64_templateVerify = Base64.encodeToString(byTemplate1, Base64.DEFAULT);

        // Base64_templateVerify is the fingure that is placed on the machine
        // Start ASYNC TASK
        if (Base64_templateVerify != null) {
          VerifyFinger VF = new VerifyFinger();
          VF.execute(Base64_templateVerify);
        } else {
          msg = "String Empty";
        }
      }

      // Make Raw Image data
      {
        NBioBSPJNI.Export.AUDIT exportAudit;

        inputFIR.SetFIRHandle(hAuditFIR);

        exportAudit = exportEngine.new AUDIT();

        exportEngine.ExportAudit(inputFIR, exportAudit);

        if (bsp.IsErrorOccured()) {

          runOnUiThread(
              new Runnable() {

                public void run() {
                  msg = "NBioBSP ExportAudit Error: " + bsp.GetErrorCode();
                }
              });

          return;
        }

        if (byCapturedRaw1 != null) byCapturedRaw1 = null;

        byCapturedRaw1 = new byte[exportAudit.FingerData[0].Template[0].Data.length];
        byCapturedRaw1 = exportAudit.FingerData[0].Template[0].Data;

        nCapturedRawWidth1 = exportAudit.ImageWidth;
        nCapturedRawHeight1 = exportAudit.ImageHeight;

        msg = "First Capture Success";
      }
    }

    runOnUiThread(
        new Runnable() {

          public void run() {

            if (byTemplate1 != null && byTemplate1 != null) {
            } else {
            }
          }
        });
  }
 @Override
 public void onDialogNegativeClick(DialogFragment dialog) {
   dialog.dismiss();
 }
Example #11
0
 private void internalDismissDialog(String tag) {
   Fragment fragment = getFragmentManager().findFragmentByTag(tag);
   if (fragment instanceof DialogFragment) {
     ((DialogFragment) fragment).dismiss();
   }
 }