Java Code Examples for org.bitcoinj.core.Coin#toPlainString()
The following examples show how to use
org.bitcoinj.core.Coin#toPlainString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 2
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 3
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 4
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 5
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 6
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 7
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 8
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 9
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 5 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr : sumStr); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } }
Example 10
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 11
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(Long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 12
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(Long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 13
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 14
Source File: TransHistoryAdapter.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
@Override public void onBindViewHolder(TransHistoryItemHolder holder, final int position) { final TransactionItem item = getTxByPosition(position); Long txSum = item.getValue(); holder.rootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.OnItemClick(position); } } }); if (item.getConfirmations() < MIN_CONFIRMATIONS) { // enableLoader(holder); holder.tvTxStatus.setText(R.string.tx_status_wait); } else { // disableLoader(holder); holder.tvTxStatus.setVisibility(View.GONE); holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); holder.viewIndicator.setVisibility(View.VISIBLE); } Coin coin = Coin.valueOf(txSum); //String sumStr = coin.toPlainString() + " " + sharedManager.getCurrentCurrency().toUpperCase(); //for tokens where decimals not equals default value = 8 int shift = getDecimal(item, tokensToRequest) - 8; if (shift != 0) { BigInteger bi = BigInteger.TEN.pow(shift < 0 ? shift * -1 : shift); coin = shift < 0 ? coin.multiply(bi.longValue()) : coin.divide(bi.longValue()); } String sumStr = coin.toPlainString(); holder.tvTransactionSum.setText(item.isOut() ? "-" + sumStr + " " + item.getTokenTicker() : sumStr + " " + item.getTokenTicker()); holder.tvDate.setText(CalendarHelper.parseDateToddMMyyyy(item.getTime() * 1000)); // if (!item.isOut()) { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_green)); // } else { // holder.viewIndicator.setBackground(view.getContext().getResources().getDrawable(R.drawable.transaction_indicator_red)); // } // holder.tvTokenTicker.setText(item.getTokenTicker()); }
Example 15
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 16
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 17
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(Long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 18
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 19
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }
Example 20
Source File: WalletManager.java From guarda-android-wallets with GNU General Public License v3.0 | 4 votes |
public void setBalance(long balance) { Coin coin = balance != 0 ? Coin.valueOf(balance) : Coin.ZERO; this.balance = new BigDecimal(coin.toPlainString()); }