use of run.wallet.iota.ui.adapter.WalletTransfersCardAdapter in project run-wallet-android by runplay.
the class WalletTransfersFragment method setAdapterOld.
private void setAdapterOld(boolean force) {
if (recyclerView != null) {
if (adapter == null) {
firstVis = 0;
adapter = new WalletTransfersCardAdapter(getActivity(), force);
} else {
firstVis = recyclerView.getVerticalScrollbarPosition();
if (force) {
WalletTransfersCardAdapter.load(getActivity(), true);
}
}
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
if (adapter.getItemCount() != 0) {
emptyTransfers.setVisibility(View.GONE);
firstLoadPod.setVisibility(View.GONE);
} else {
if (Store.getCurrentWallet() != null) {
emptyTransfers.setVisibility(View.VISIBLE);
}
}
filterBar.setVisibility(View.GONE);
if (WalletTransfersCardAdapter.getFilterAddress() != null) {
Address address = Store.isAlreadyAddress(WalletTransfersCardAdapter.getFilterAddress(), Store.getAddresses());
if (address != null) {
filterBar.setVisibility(View.VISIBLE);
filterBar.setBackgroundColor(AppTheme.getColorPrimaryDark(getActivity()));
IotaToText.IotaDisplayData data = IotaToText.getIotaDisplayData(address.getValue());
filterAddress.setText(address.getAddress());
filterId.setText(WalletTransfersCardAdapter.getFilterAddressId());
filterBalance.setText(data.value);
filterBalanceThird.setText(data.thirdDecimal);
filterBalanceUnit.setText(data.unit);
}
}
recyclerView.scrollToPosition(firstVis);
}
}
Aggregations