aaddas

adasda
mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.6 kB
1
Indexable
Never
Fragment///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

autFragment.setOperationCallback(new AuthorizationOperationCallback<Object>() {
            @Override
            public void autorizacionInicio(MitosisUseCaseCallback<DatosEncriptacion> callback) {
                if (isSignature) {
                    presenter.launchSignatureAuthInit(callback);
                } else {
                    presenter.launchCancelAuthInit(callback);
                }
            }

            @Override
            public void autorizacionResultado(ClavesAutorizacion claves, MitosisUseCaseCallback<Object> callback) {
                if (isSignature) {
                    presenter.launchSignatureAuthResult(claves, callback);
                } else {
                    presenter.launchCancelAuthResult(claves, callback);
                }
            }
        });

        forwardAuthorization();
    }

RepoImpl //////////////////// 
 private MultifirmaSGDataSource dataSource;
 @Override public FDFSignatureConfirmOutApi confirmCancel(EntradaConfirmacionFirma inputData) {
        return FDFMapperUtils.mapApiModel(dataSource.anulacionConfirmacion(inputData), FDFSignatureConfirmOutApi.class);
    }

Repo /////

SalidaResultadoFirma signatureAuthResult(ClavesAutorizacion inputData);

Module de dagger - usecasemodule ///////////////////////////////////

    @Provides SignatureAuthInitUseCase provideSignatureAuthInitUseCase(SimpleSignatureRepository repository) {
        return new SignatureAuthInitUseCaseImpl(repository);
    }

/// OTRO ejemplo en fgragmente
    @Override
    public void launchMitosisAutFragment(FDFContractDetailModel contractDetailModel, boolean isSignature) {
        if (autFragment != null) {
            hideAutFragment();
        }

        final MCAMitosisAUTModule module = (MCAMitosisAUTModule) getRegisteredApplicationModule(MCAMitosisAUTModule.MODULE_NAME);
        autFragment = module.getMCAManager().getAutFragment(true, false);

        autFragment.setResultCallbacks(new AuthorizationResultCallbacks() {
            @Override
            public void onSuccess(Object result) {
                presenter.onAutCallback(result);
            }

            @Override
            public void onInitializationError(Throwable throwable) {
                presenter.onAutInitError(throwable);
            }

            @Override
            public void onCancelled() {
                hideAutFragment();
            }
        });