Merge pull request #15990 from brave/android_wallet_nft_ui_parity

[Android] Disable click on NFTs; filter accounts for NFTs
This commit is contained in:
wchen342
2022-11-18 18:34:55 +02:00
committed by GitHub
2 changed files with 18 additions and 11 deletions
@@ -347,24 +347,28 @@ public class AssetDetailActivity
String.format(Locale.getDefault(), "%.4f %s",
thisAccountBalance, mAsset.symbol);
// if NFT, only show the account that owns it (i.e.
// balance = 1)
if (mAsset.isNft && thisAccountBalance != 1.) continue;
WalletListItemModel model = new WalletListItemModel(
R.drawable.ic_eth, accountInfo.name,
accountInfo.address, fiatBalanceString,
cryptoBalanceString, accountInfo.isImported);
model.setAccountInfo(accountInfo);
walletListItemModelList.add(model);
}
if (walletCoinAdapter != null) {
walletCoinAdapter.setWalletListItemModelList(
walletListItemModelList);
walletCoinAdapter.setOnWalletListItemClick(
AssetDetailActivity.this);
walletCoinAdapter.setWalletListItemType(
Utils.ACCOUNT_ITEM);
rvAccounts.setAdapter(walletCoinAdapter);
rvAccounts.setLayoutManager(new LinearLayoutManager(
AssetDetailActivity.this));
}
if (walletCoinAdapter != null) {
walletCoinAdapter.setWalletListItemModelList(
walletListItemModelList);
walletCoinAdapter.setOnWalletListItemClick(
AssetDetailActivity.this);
walletCoinAdapter.setWalletListItemType(
Utils.ACCOUNT_ITEM);
rvAccounts.setAdapter(walletCoinAdapter);
rvAccounts.setLayoutManager(new LinearLayoutManager(
AssetDetailActivity.this));
}
});
});
@@ -302,6 +302,9 @@ public class PortfolioFragment
if (selectedNetwork == null) {
return;
}
// TODO (Wengling): re-enable when NFT portfolio is done
if (asset.isNft) return;
Utils.openAssetDetailsActivity(getActivity(), selectedNetwork.chainId, asset);
}