- Now the name of the coins appears in the balances, instead of "unknown";
This commit is contained in:
parent
08152814b3
commit
131a5c5ea8
2 changed files with 9 additions and 2 deletions
|
@ -20,7 +20,7 @@ public interface CryptoCurrencyDao {
|
|||
List<CryptoCurrency> getAll();
|
||||
|
||||
@Query("SELECT * FROM crypto_currency WHERE id = :id")
|
||||
CryptoCurrency getById(int id);
|
||||
CryptoCurrency getById(long id);
|
||||
|
||||
@Query("SELECT * FROM crypto_currency WHERE id IN (:ids)")
|
||||
List<CryptoCurrency> getByIds(List<Long> ids);
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package cy.agorise.crystalwallet.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import cy.agorise.crystalwallet.R;
|
||||
import cy.agorise.crystalwallet.dao.CrystalDatabase;
|
||||
import cy.agorise.crystalwallet.models.CryptoCoinBalance;
|
||||
import cy.agorise.crystalwallet.models.CryptoCoinTransaction;
|
||||
import cy.agorise.crystalwallet.models.CryptoCurrency;
|
||||
|
||||
/**
|
||||
* Created by Henry Varona on 17/9/2017.
|
||||
|
@ -15,11 +18,13 @@ import cy.agorise.crystalwallet.models.CryptoCoinTransaction;
|
|||
public class CryptoCoinBalanceViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView cryptoCoinName;
|
||||
private TextView cryptoCoinBalance;
|
||||
private Context context;
|
||||
|
||||
public CryptoCoinBalanceViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
cryptoCoinName = (TextView) itemView.findViewById(R.id.tvCryptoCoinName);
|
||||
cryptoCoinBalance = (TextView) itemView.findViewById(R.id.tvCryptoCoinBalanceAmount);
|
||||
this.context = itemView.getContext();
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,7 +38,9 @@ public class CryptoCoinBalanceViewHolder extends RecyclerView.ViewHolder {
|
|||
cryptoCoinName.setText("loading...");
|
||||
cryptoCoinBalance.setText("");
|
||||
} else {
|
||||
//cryptoCoinName.setText(balance.getCoin().getLabel());
|
||||
CryptoCurrency currency = CrystalDatabase.getAppDatabase(this.context).cryptoCurrencyDao().getById(balance.getCryptoCurrencyId());
|
||||
|
||||
cryptoCoinName.setText(currency.getName());
|
||||
cryptoCoinBalance.setText(""+balance.getBalance());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue