Search in sources :

Example 1 with WalletTransfersCardAdapter

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);
    }
}
Also used : Address(run.wallet.iota.model.Address) IotaToText(jota.utils.IotaToText) WalletTransfersCardAdapter(run.wallet.iota.ui.adapter.WalletTransfersCardAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 IotaToText (jota.utils.IotaToText)1 Address (run.wallet.iota.model.Address)1 WalletTransfersCardAdapter (run.wallet.iota.ui.adapter.WalletTransfersCardAdapter)1