2017-10-12 02:08:42 +00:00
|
|
|
package cy.agorise.crystalwallet.views;
|
|
|
|
|
2017-10-18 00:35:37 +00:00
|
|
|
import android.arch.lifecycle.ViewModelProviders;
|
2017-10-12 02:08:42 +00:00
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
import cy.agorise.crystalwallet.R;
|
|
|
|
import cy.agorise.crystalwallet.models.CryptoCoinTransaction;
|
|
|
|
import cy.agorise.crystalwallet.models.CryptoNetBalance;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Henry Varona on 17/9/2017.
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class CryptoNetBalanceViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
private ImageView cryptoNetIcon;
|
|
|
|
private TextView cryptoNetName;
|
2017-10-15 02:02:55 +00:00
|
|
|
private CryptoCoinBalanceListView cryptoCoinBalanceListView;
|
2017-10-12 02:08:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
public CryptoNetBalanceViewHolder(View itemView) {
|
|
|
|
super(itemView);
|
|
|
|
cryptoNetIcon = (ImageView) itemView.findViewById(R.id.ivCryptoNetIcon);
|
|
|
|
cryptoNetName = (TextView) itemView.findViewById(R.id.tvCryptoNetName);
|
2017-10-18 00:35:37 +00:00
|
|
|
cryptoCoinBalanceListView = (CryptoCoinBalanceListView) itemView.findViewById(R.id.cryptoCoinBalancesListView);
|
2017-10-12 02:08:42 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void clear(){
|
|
|
|
cryptoNetName.setText("loading...");
|
|
|
|
}
|
|
|
|
|
|
|
|
public void bindTo(final CryptoNetBalance balance) {
|
|
|
|
if (balance == null){
|
|
|
|
cryptoNetName.setText("loading...");
|
|
|
|
} else {
|
2017-10-15 02:02:55 +00:00
|
|
|
cryptoNetName.setText(balance.getCryptoNet().getLabel());
|
2017-10-18 00:35:37 +00:00
|
|
|
|
|
|
|
/*transactionListView = this.findViewById(R.id.transaction_list);
|
|
|
|
|
|
|
|
transactionListViewModel = ViewModelProviders.of(getContext).get(TransactionListViewModel.class);
|
|
|
|
LiveData<PagedList<CryptoCoinTransaction>> transactionData = transactionListViewModel.getTransactionList();
|
|
|
|
transactionListView.setData(null);
|
|
|
|
|
|
|
|
transactionData.observe(this, new Observer<PagedList<CryptoCoinTransaction>>() {
|
|
|
|
@Override
|
|
|
|
public void onChanged(PagedList<CryptoCoinTransaction> cryptoCoinTransactions) {
|
|
|
|
transactionListView.setData(cryptoCoinTransactions);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
cryptoCoinBalanceListView.setData();*/
|
2017-10-12 02:08:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|