private void setupViews() { setContentView(R.layout.base_layout); mFragment = (OnyxFragment) getFragmentManager().findFragmentById(R.id.onyx_frag); CaptureConfiguration captureConfig = new CaptureConfigurationBuilder() .setProcessedBitmapCallback(mProcessedCallback) .setWsqCallback(mWsqCallback) .setFingerprintTemplateCallback(mTemplateCallback) .setShouldInvert(true) .setFlip(Flip.VERTICAL) .buildCaptureConfiguration(); mFragment.setCaptureConfiguration(captureConfig); mFragment.setErrorCallback(mErrorCallback); mFragment.startOneShotAutoCapture(); createFadeInAnimation(); createFadeOutAnimation(); LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); mFingerprintView = new ImageView(this); addContentView(mFingerprintView, layoutParams); }
@Override /** * This method handles the errors that can be produced by the OnyxFragment. * * @param error the specific error enumeration that occurred. * @param errorMessage the associated error message. * @param exception if not null, this is the exception that occurred. */ public void onError(Error error, String errorMessage, Exception exception) { switch (error) { case AUTOFOCUS_FAILURE: mFragment.startOneShotAutoCapture(); break; default: Log.d(TAG, "Error occurred: " + errorMessage); break; } }