@Override public void onErrorOccurred(Exception ex) { isRefreshing = false; if (isAttached) { swipeRefreshLayout.setRefreshing(false); CommonLogger.exception(TAG, ex.getMessage(), ex); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); try { errorManager = appSession.getErrorManager(); moduleManager = appSession.getModuleManager(); users = getMoreDataAsync(FermatRefreshTypes.NEW, 0); } catch (Exception ex) { CommonLogger.exception(TAG, ex.getMessage(), ex); if (errorManager != null) errorManager.reportUnexpectedWalletException( Wallets.DAP_ASSET_ISSUER_WALLET, UnexpectedWalletExceptionSeverity.DISABLES_THIS_FRAGMENT, ex); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); try { appSession.setData("users", null); moduleManager = ((AssetIssuerSession) appSession).getModuleManager(); errorManager = appSession.getErrorManager(); settingsManager = appSession.getModuleManager().getSettingsManager(); } catch (Exception ex) { CommonLogger.exception(TAG, ex.getMessage(), ex); if (errorManager != null) errorManager.reportUnexpectedWalletException( Wallets.DAP_ASSET_ISSUER_WALLET, UnexpectedWalletExceptionSeverity.DISABLES_THIS_FRAGMENT, ex); } }
@Override public List<DigitalAsset> getMoreDataAsync(FermatRefreshTypes refreshType, int pos) { List<DigitalAsset> digitalAssets = new ArrayList<>(); if (moduleManager != null) { try { digitalAssets = Data.getAllDigitalAssets(moduleManager); } catch (Exception ex) { CommonLogger.exception(TAG, ex.getMessage(), ex); if (errorManager != null) errorManager.reportUnexpectedWalletException( Wallets.DAP_ASSET_ISSUER_WALLET, UnexpectedWalletExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT, ex); } } else { Toast.makeText(getActivity(), R.string.dap_issuer_wallet_system_error, Toast.LENGTH_SHORT) .show(); } return digitalAssets; }
@Override public List<UserDelivery> getMoreDataAsync(FermatRefreshTypes refreshType, int pos) { List<UserDelivery> users = new ArrayList<>(); if (moduleManager != null) { try { if (digitalAsset == null) digitalAsset = (DigitalAsset) appSession.getData("asset_data"); users = Data.getUserDeliveryList( WalletUtilities.WALLET_PUBLIC_KEY, digitalAsset, moduleManager); } catch (Exception ex) { CommonLogger.exception(TAG, ex.getMessage(), ex); if (errorManager != null) errorManager.reportUnexpectedWalletException( Wallets.DAP_ASSET_ISSUER_WALLET, UnexpectedWalletExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT, ex); } } else { Toast.makeText(getActivity(), R.string.dap_issuer_wallet_system_error, Toast.LENGTH_SHORT) .show(); } return users; }