@Override
  public List<CryptoBrokerIdentity> getMoreDataAsync(FermatRefreshTypes refreshType, int pos) {
    List<CryptoBrokerIdentity> data = new ArrayList<>();

    try {
      data.addAll(walletManager.getListOfIdentities());
      if (walletManager.getListOfIdentities().isEmpty()) {
        PresentationDialog presentationDialog =
            new PresentationDialog.Builder(getActivity(), appSession)
                .setTemplateType(PresentationDialog.TemplateType.TYPE_PRESENTATION)
                .setBannerRes(R.drawable.banner_crypto_broker)
                .setIconRes(R.drawable.crypto_broker)
                .setBody("Custom text support for dialog in the wizard identities help 2")
                .setSubTitle("This is a simple wallet for exchange Merchandise. " + identities)
                .setTextFooter(
                    "To begin, choose an avatar below. You might change it later with any picture and your alias")
                .build();
        presentationDialog.setOnDismissListener(this);
        presentationDialog.show();
      }

    } catch (FermatException ex) {

      Log.e(TAG, ex.getMessage(), ex);
      if (errorManager != null) {
        errorManager.reportUnexpectedWalletException(
            Wallets.CBP_CRYPTO_BROKER_WALLET,
            UnexpectedWalletExceptionSeverity.DISABLES_THIS_FRAGMENT,
            ex);
      }
    }

    return data;
  }
Beispiel #2
0
  private void launchPresentationDialog() {
    try {
      DialogInterface.OnDismissListener onDismissListener =
          new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
              try {
                identity = moduleManager.getSelectedActorIdentity();
                loadSelectedActorIdentityInBackground();
                if (identity == null) getActivity().onBackPressed();
                else {
                  invalidate();
                  onRefresh();
                }
              } catch (Exception e) {
                e.printStackTrace();
              }
            }
          };

      if (launchActorCreationDialog) {
        PresentationDialog presentationDialog =
            new PresentationDialog.Builder(getActivity(), appSession)
                .setTemplateType(PresentationDialog.TemplateType.TYPE_PRESENTATION)
                .setBannerRes(R.drawable.ccc_banner)
                .setIconRes(R.drawable.crypto_customer)
                .setSubTitle(R.string.cbp_ccc_launch_action_creation_dialog_sub_title)
                .setBody(R.string.cbp_ccc_launch_action_creation_dialog_body)
                .setTextFooter(R.string.cbp_ccc_launch_action_creation_dialog_footer)
                .setTextNameLeft(R.string.cbp_ccc_launch_action_creation_name_left)
                .setTextNameRight(R.string.cbp_ccc_launch_action_creation_name_right)
                .setIsCheckEnabled(false)
                .build();

        presentationDialog.setOnDismissListener(onDismissListener);
        presentationDialog.show();

      } else if (launchListIdentitiesDialog) {
        ListIdentitiesDialog listIdentitiesDialog =
            new ListIdentitiesDialog(getActivity(), appSession, appResourcesProviderManager);

        listIdentitiesDialog.setOnDismissListener(onDismissListener);
        listIdentitiesDialog.show();

      } else {
        onRefresh();
      }

    } catch (Exception ex) {
      errorManager.reportUnexpectedUIException(
          UISource.ACTIVITY,
          UnexpectedUIExceptionSeverity.CRASH,
          FermatException.wrapException(ex));
      Toast.makeText(
              getActivity().getApplicationContext(),
              "Oooops! recovering from system error",
              Toast.LENGTH_SHORT)
          .show();
    }
  }
  private void setUpPresentation(boolean checkButton) {
    try {
      PresentationDialog presentationDialog =
          new PresentationDialog.Builder(getActivity(), appSession)
              .setBannerRes(R.drawable.banner_asset_issuer_wallet)
              .setIconRes(R.drawable.asset_issuer)
              .setImageLeft(R.drawable.asset_issuer_identity)
              .setVIewColor(R.color.dap_issuer_view_color)
              .setTitleTextColor(R.color.dap_issuer_view_color)
              .setTextNameLeft(R.string.dap_issuer_wallet_welcome_name_left)
              .setSubTitle(R.string.dap_issuer_wallet_welcome_subTitle)
              .setBody(R.string.dap_issuer_wallet_welcome_body)
              .setTextFooter(R.string.dap_issuer_wallet_welcome_Footer)
              .setTemplateType(
                  (moduleManager.getActiveAssetIssuerIdentity() == null)
                      ? PresentationDialog.TemplateType.DAP_TYPE_PRESENTATION
                      : PresentationDialog.TemplateType.TYPE_PRESENTATION_WITHOUT_IDENTITIES)
              .setIsCheckEnabled(checkButton)
              .build();

      presentationDialog.setOnDismissListener(
          new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
              Object o =
                  appSession.getData(SessionConstantsAssetIssuer.PRESENTATION_IDENTITY_CREATED);
              if (o != null) {
                if ((Boolean) (o)) {
                  // invalidate();
                  appSession.removeData(SessionConstantsAssetIssuer.PRESENTATION_IDENTITY_CREATED);
                }
              }
              try {
                IdentityAssetIssuer identityAssetIssuer =
                    moduleManager.getActiveAssetIssuerIdentity();
                if (identityAssetIssuer == null) {
                  getActivity().onBackPressed();
                } else {
                  invalidate();
                }
              } catch (CantGetIdentityAssetIssuerException e) {
                e.printStackTrace();
              }
            }
          });

      presentationDialog.show();
    } catch (CantGetIdentityAssetIssuerException e) {
      e.printStackTrace();
    }
  }
  private void setUpPresentation(boolean checkButton) {
    try {
      PresentationDialog presentationDialog =
          new PresentationDialog.Builder(getActivity(), appSession)
              .setBannerRes(R.drawable.banner_redeem_point)
              .setIconRes(R.drawable.redeem_point)
              .setVIewColor(R.color.dap_identity_redeem_view_color)
              .setTitleTextColor(R.color.dap_identity_redeem_view_color)
              .setSubTitle("Welcome to the Redeem Point Identity.")
              .setBody(
                  "From here you will be able to create a Redeem Point type identity.\n\n"
                      + "This Identity will identify you in the system as a redeem point, and give you access to all tasks and applications you need.\n\n"
                      + "Other Asset Users will be able to request connection to you by finding you with the information you provide here.")
              .setTemplateType(PresentationDialog.TemplateType.TYPE_PRESENTATION_WITHOUT_IDENTITIES)
              .setIsCheckEnabled(checkButton)
              .build();

      //            presentationDialog.setOnDismissListener(new DialogInterface.OnDismissListener()
      // {
      //                @Override
      //                public void onDismiss(DialogInterface dialog) {
      //                    Object o =
      // appSession.getData(SessionConstantsAssetFactory.PRESENTATION_IDENTITY_CREATED);
      //                    if (o != null) {
      //                        if ((Boolean) (o)) {
      //                            //invalidate();
      //
      // appSession.removeData(SessionConstantsAssetFactory.PRESENTATION_IDENTITY_CREATED);
      //                        }
      //                    }
      //                    IdentityAssetIssuer identityAssetIssuer = null;
      //                    try {
      //                        identityAssetIssuer = moduleManager.getIdentityAssetIssuer();
      //                    } catch (CantGetAssetIssuerIdentitiesException e) {
      //                        e.printStackTrace();
      //                    }
      //                    if (identityAssetIssuer == null) {
      //                        getActivity().onBackPressed();
      //                    } else {
      //                        invalidate();
      //                    }
      //                }
      //            });

      presentationDialog.show();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  private void setUpHelpAssetDeliveryList(boolean checkButton) {
    try {
      PresentationDialog presentationDialog =
          new PresentationDialog.Builder(getActivity(), appSession)
              .setBannerRes(R.drawable.banner_asset_issuer_wallet)
              .setIconRes(R.drawable.asset_issuer)
              .setVIewColor(R.color.dap_issuer_view_color)
              .setTitleTextColor(R.color.dap_issuer_view_color)
              .setSubTitle(R.string.dap_issuer_wallet_delivery_list_subTitle)
              .setBody(R.string.dap_issuer_wallet_delivery_list_body)
              .setTemplateType(PresentationDialog.TemplateType.TYPE_PRESENTATION_WITHOUT_IDENTITIES)
              .setIsCheckEnabled(checkButton)
              .build();

      presentationDialog.show();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Beispiel #6
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case FragmentsCommons.HELP_OPTION_MENU_ID:
        if (helpDialog == null)
          helpDialog =
              new PresentationDialog.Builder(getActivity(), appSession)
                  .setTemplateType(
                      PresentationDialog.TemplateType.TYPE_PRESENTATION_WITHOUT_IDENTITIES)
                  .setBannerRes(R.drawable.ccc_banner)
                  .setIconRes(R.drawable.crypto_customer)
                  .setSubTitle(R.string.cbp_ccc_launch_action_creation_dialog_sub_title)
                  .setBody(R.string.cbp_ccc_launch_action_creation_dialog_body)
                  .setIsCheckEnabled(false)
                  .build();

        helpDialog.show();

        return true;

      case FragmentsCommons.LOCATION_FILTER_OPTION_MENU_ID:
        try {
          geolocationDialog =
              new GeolocationDialog(getActivity(), appSession, appResourcesProviderManager, this);
          geolocationDialog.show();

        } catch (Exception e) {
          errorManager.reportUnexpectedSubAppException(
              SubApps.CBP_CRYPTO_BROKER_COMMUNITY,
              UnexpectedSubAppExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT,
              e);
        }
    }

    return false;
  }