package io.trustbuilder.mfa.android.demoapp.screen;

import android.os.Bundle;
import android.util.Log;

import io.trustbuilder.mfa.android.demoapp.R;
import io.trustbuilder.mfa.lib.usecase.definition.securetokenlisting.SecureTokenListing;

public class SecureTokenListingActivity extends TrustBuilderActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate: SecureTokenListingUseCase");
        setTitle(this.getClass().getSimpleName());
        setContentView(R.layout.activity_secure_token);
        this.proceed = this.findViewById(R.id.proceed_SecureToken);
        this.result = this.findViewById(R.id.result_SecureToken);
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "onStart: SecureTokenListingUseCase");
        this.proceed.setOnClickListener((v) -> {
            SecureTokenListing secureTokenListing = mfaLib.startSecureTokenListing();
            displayJsonResult(secureTokenListing.execute());
        });
    }
}
