コード例 #1
0
  @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;
  }
コード例 #2
0
  private void saveSettingAndGoNextStep() {
    if (locationList.isEmpty()) {
      Toast.makeText(getActivity(), R.string.ccw_add_location_warning_msg, Toast.LENGTH_SHORT)
          .show();
      return;
    }

    try {
      for (String location : locationList) {
        walletManager.createNewLocation(location, appSession.getAppPublicKey());
      }

    } catch (FermatException ex) {
      Toast.makeText(getActivity(), "Oops a error occurred...", Toast.LENGTH_SHORT).show();

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

    changeActivity(Activities.CBP_CRYPTO_CUSTOMER_WALLET_SETTINGS, appSession.getAppPublicKey());
  }
コード例 #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    try {
      CryptoBrokerWalletModuleManager moduleManager =
          ((CryptoBrokerWalletSession) appSession).getModuleManager();
      walletManager = moduleManager.getCryptoBrokerWallet(appSession.getAppPublicKey());
      errorManager = appSession.getErrorManager();

      identities = getMoreDataAsync(FermatRefreshTypes.NEW, 0);

    } catch (FermatException ex) {
      Log.e(TAG, ex.getMessage(), ex);
    }
  }