public List<WalletAccount> getAllAccounts() { if (wallet != null) { return wallet.getAllAccounts(); } else { return ImmutableList.of(); } }
public AccountListAdapter(final Context context, @Nonnull final Wallet wallet) { inflater = LayoutInflater.from(context); accounts.addAll(wallet.getAllAccounts()); this.rates = new HashMap<>(); }
public void replace(@Nonnull final Wallet wallet) { accounts.clear(); accounts.addAll(wallet.getAllAccounts()); notifyDataSetChanged(); }
@Override public void onPause() { // TODO add an event listener to the Wallet class for (WalletAccount account : wallet.getAllAccounts()) { account.removeEventListener(walletChangeListener); } walletChangeListener.removeCallbacks(); super.onPause(); }
@Override public void onResume() { super.onResume(); // TODO add an event listener to the Wallet class for (WalletAccount account : wallet.getAllAccounts()) { account.addEventListener(walletChangeListener, Threading.SAME_THREAD); } updateWallet(); updateView(); }
private void calculateNewBalance() { currentBalance = null; for (WalletAccount w : wallet.getAllAccounts()) { ExchangeRate rate = exchangeRates.get(w.getCoinType().getSymbol()); if (rate == null) { log.info("Missing exchange rate for {}, skipping...", w.getCoinType().getName()); continue; } if (currentBalance != null) { currentBalance = currentBalance.add(rate.rate.convert(w.getBalance())); } else { currentBalance = rate.rate.convert(w.getBalance()); } } }
private static void updateV1toV2(Wallet wallet) { checkState(wallet.getVersion() < 2, "Can update only from version < 2"); wallet.setVersion(2); for (WalletAccount walletAccount : wallet.getAllAccounts()) { if (walletAccount instanceof WalletPocketHD) { WalletPocketHD account = (WalletPocketHD) walletAccount;
for (WalletAccount account : wallet.getAllAccounts()) { account.refresh(); for (WalletAccount account : wallet.getAllAccounts()) { clients.startAsync(account);
for (WalletAccount account : wallet.getAllAccounts()) { Protos.WalletPocket pocketProto; if (account instanceof WalletPocketHD) {