Skip to content

Commit

Permalink
feat: add schema detection to enable embedded view
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Jan 18, 2024
1 parent 93f9c42 commit 9ca0b18
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public class NFTAssetDetailActivity extends BaseActivity implements StandardFunc
private boolean triggeredReload;
private long chainId;
private Web3TokenView tokenScriptView;
private static final boolean FORCE_EMBEDDED_VIEWER = true;
private boolean useNativeTokenScript = false;

Check warning on line 118 in app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java

View check run for this annotation

Codecov / codecov/patch

app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java#L118

Added line #L118 was not covered by tests

@Override
Expand Down Expand Up @@ -306,6 +307,11 @@ private void setup()
setTitle(token.tokenInfo.name);
updateDefaultTokenData();

if (!NFTAssetDetailActivity.FORCE_EMBEDDED_VIEWER) {
TokenDefinition td = viewModel.getAssetDefinitionService().getAssetDefinition(this.token);
this.useNativeTokenScript = td.nameSpace != null;
}

if (asset != null && asset.isAttestation())
{
setupAttestation(viewModel.getAssetDefinitionService().getAssetDefinition(token));
Expand Down Expand Up @@ -346,6 +352,9 @@ private void newScriptFound(TokenDefinition td)

setTitle(token.getTokenName(viewModel.getAssetDefinitionService(), 1));

if (!NFTAssetDetailActivity.FORCE_EMBEDDED_VIEWER)
this.useNativeTokenScript = td.nameSpace != null;

//now re-load the verbs if already called. If wallet is null this won't complete
setupFunctionBar(viewModel.getWallet());

Expand Down

0 comments on commit 9ca0b18

Please sign in to comment.