@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); referenceWalletSession = (LossProtectedWalletSession) appSession; lst = new ArrayList<LossProtectedWalletTransaction>(); getExecutor() .execute( new Runnable() { @Override public void run() { // final Drawable drawable = // getResources().getDrawable(R.drawable.background_gradient, null); getActivity() .runOnUiThread( new Runnable() { @Override public void run() { // // getPaintActivtyFeactures().setActivityBackgroundColor(drawable); } }); } }); try { cryptoWallet = referenceWalletSession.getModuleManager().getCryptoWallet(); settingsManager = referenceWalletSession.getModuleManager().getSettingsManager(); LossProtectedWalletSettings bitcoinWalletSettings; try { bitcoinWalletSettings = settingsManager.loadAndGetSettings(referenceWalletSession.getAppPublicKey()); this.blockchainNetworkType = bitcoinWalletSettings.getBlockchainNetworkType(); } catch (Exception e) { } onRefresh(); } catch (Exception ex) { ex.printStackTrace(); // CommonLogger.exception(TAG, ex.getMessage(), ex); Toast.makeText( getActivity().getApplicationContext(), "Oooops! recovering from system error", Toast.LENGTH_SHORT) .show(); } }
// TODO: check this and everything else that it is not needed anymore. @Override public void onClick(View v) { try { LossProtectedPaymentRequest paymentRequest = referenceWalletSession.getLastRequestSelected(); int id = v.getId(); if (id == R.id.btn_refuse_request) { cryptoWallet.refuseRequest(paymentRequest.getRequestId()); Toast.makeText(getActivity(), "Denegado", Toast.LENGTH_SHORT).show(); } else if (id == R.id.btn_accept_request) { cryptoWallet.approveRequest( paymentRequest.getRequestId(), referenceWalletSession.getIntraUserModuleManager().getPublicKey()); Toast.makeText(getActivity(), "Aceptado", Toast.LENGTH_SHORT).show(); } } catch (Exception e) { WalletUtils.showMessage( getActivity(), "Cant Accept or Denied Send Payment Exception- " + e.getMessage()); } }
@Override public void onActivityCreated(Bundle savedInstanceState) { try { super.onActivityCreated(savedInstanceState); lst = new ArrayList<LossProtectedWalletTransaction>(); } catch (Exception e) { makeText(getActivity(), "Oooops! recovering from system error", Toast.LENGTH_SHORT).show(); referenceWalletSession .getErrorManager() .reportUnexpectedUIException(UISource.VIEW, UnexpectedUIExceptionSeverity.CRASH, e); } }
@Override public List<LossProtectedWalletTransaction> getMoreDataAsync( FermatRefreshTypes refreshType, int pos) { List<LossProtectedWalletTransaction> list = new ArrayList<LossProtectedWalletTransaction>(); try { // when refresh offset set 0 if (refreshType.equals(FermatRefreshTypes.NEW)) offset = 0; LossProtectedWalletIntraUserIdentity intraUserLoginIdentity = referenceWalletSession.getIntraUserModuleManager(); if (intraUserLoginIdentity != null) { String intraUserPk = intraUserLoginIdentity.getPublicKey(); lst = cryptoWallet.listLastActorTransactionsByTransactionType( BalanceType.AVAILABLE, TransactionType.CREDIT, referenceWalletSession.getAppPublicKey(), intraUserPk, blockchainNetworkType, MAX_TRANSACTIONS, 0); offset += MAX_TRANSACTIONS; } } catch (Exception e) { referenceWalletSession .getErrorManager() .reportUnexpectedSubAppException( SubApps.CWP_WALLET_STORE, UnexpectedSubAppExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT, e); e.printStackTrace(); } return lst; }