use of wannabit.io.cosmostaion.dao.ChainAccounts in project cosmostation-android by cosmostation.
the class WalletSwitchActivity method setExpendChains.
public void setExpendChains() {
mExpendedChains.clear();
for (ChainAccounts chainAccounts : mChainAccounts) {
if (chainAccounts.opened) {
mExpendedChains.add(chainAccounts.baseChain);
}
}
getBaseDao().setExpendedChains(mExpendedChains);
}
use of wannabit.io.cosmostaion.dao.ChainAccounts in project cosmostation-android by cosmostation.
the class WalletSwitchActivity method loadChains.
private void loadChains() {
mAccount = getBaseDao().onSelectAccount(getBaseDao().getLastUser());
ArrayList<BaseChain> mDisplayChains = getBaseDao().dpSortedChains();
mExpendedChains = getBaseDao().getExpendedChains();
mSelectedChain = BaseChain.getChain(mAccount.baseChain);
getBaseDao().setLastChain(mSelectedChain.getChain());
for (BaseChain chain : mDisplayChains) {
if (mExpendedChains.contains(chain) || mSelectedChain.equals(chain)) {
mChainAccounts.add(new ChainAccounts(true, chain, getBaseDao().onSelectAccountsByChain(chain)));
} else {
mChainAccounts.add(new ChainAccounts(false, chain, getBaseDao().onSelectAccountsByChain(chain)));
}
}
mAccountRecyclerView.scrollToPosition(getBaseDao().dpSortedChains().indexOf(mSelectedChain));
mAccountListAdapter.notifyDataSetChanged();
}
use of wannabit.io.cosmostaion.dao.ChainAccounts in project cosmostation-android by cosmostation.
the class MainActivity method onChainSelect.
private void onChainSelect(BaseChain baseChain) {
invalidateOptionsMenu();
mChainAccounts.clear();
ArrayList<BaseChain> mDisplayChains = new ArrayList<>();
mDisplayChains = getBaseDao().dpSortedChains();
mExpendedChains = getBaseDao().getExpendedChains();
mSelectedChain = baseChain;
getBaseDao().setLastChain(mSelectedChain.getChain());
for (BaseChain chain : mDisplayChains) {
if (mExpendedChains.contains(chain) || mSelectedChain.equals(chain)) {
mChainAccounts.add(new ChainAccounts(true, chain, getBaseDao().onSelectAccountsByChain(chain)));
} else {
mChainAccounts.add(new ChainAccounts(false, chain, getBaseDao().onSelectAccountsByChain(chain)));
}
}
}
Aggregations