diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-02-10 17:44:52 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-02-10 17:44:52 +0100 |
commit | a94713103b6c72136fbf4886bf561616b2a01e4e (patch) | |
tree | ce26bb1ef93e25d79276ab6b18167e7e927d4cb7 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 751298a4d832f316244fd6345c46ba806dcfc860 (diff) | |
parent | 0191cf92dba72c066c355dc0f67b332c00e659de (diff) | |
download | open-keychain-a94713103b6c72136fbf4886bf561616b2a01e4e.tar.gz open-keychain-a94713103b6c72136fbf4886bf561616b2a01e4e.tar.bz2 open-keychain-a94713103b6c72136fbf4886bf561616b2a01e4e.zip |
Merge pull request #1705 from fidesmo/feature-better-transaction-animation
Better transaction animation
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SecurityTokenOperationActivity.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SecurityTokenOperationActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SecurityTokenOperationActivity.java index 130dd6a79..772dfe070 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SecurityTokenOperationActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SecurityTokenOperationActivity.java @@ -49,6 +49,8 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; +import nordpol.android.NfcGuideView; + /** * This class provides a communication interface to OpenPGP applications on ISO SmartCard compliant * NFC devices. @@ -67,6 +69,7 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity public ViewAnimator vAnimator; public TextView vErrorText; public Button vErrorTryAgainButton; + public NfcGuideView nfcGuideView; private RequiredInputParcel mRequiredInput; private Intent mServiceIntent; @@ -88,6 +91,8 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity super.onCreate(savedInstanceState); Log.d(Constants.TAG, "NfcOperationActivity.onCreate"); + nfcGuideView = (NfcGuideView) findViewById(R.id.nfc_guide_view); + // prevent annoying orientation changes while fumbling with the device OrientationUtils.lockOrientation(this); // prevent close when touching outside of the dialog (happens easily when fumbling with the device) @@ -101,6 +106,9 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity vAnimator = (ViewAnimator) findViewById(R.id.view_animator); vAnimator.setDisplayedChild(0); + + nfcGuideView.setCurrentStatus(NfcGuideView.NfcGuideViewStatus.STARTING_POSITION); + vErrorText = (TextView) findViewById(R.id.security_token_activity_3_error_text); vErrorTryAgainButton = (Button) findViewById(R.id.security_token_activity_3_error_try_again); vErrorTryAgainButton.setOnClickListener(new View.OnClickListener() { @@ -110,6 +118,9 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity obtainPassphraseIfRequired(); vAnimator.setDisplayedChild(0); + + nfcGuideView.setVisibility(View.VISIBLE); + nfcGuideView.setCurrentStatus(NfcGuideView.NfcGuideViewStatus.STARTING_POSITION); } }); Button vCancel = (Button) findViewById(R.id.security_token_activity_0_cancel); @@ -147,6 +158,7 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity public void onNfcPreExecute() { // start with indeterminate progress vAnimator.setDisplayedChild(1); + nfcGuideView.setCurrentStatus(NfcGuideView.NfcGuideViewStatus.TRANSFERRING); } @Override @@ -277,6 +289,8 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity // show finish vAnimator.setDisplayedChild(2); + nfcGuideView.setCurrentStatus(NfcGuideView.NfcGuideViewStatus.DONE); + new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { @@ -307,6 +321,8 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenNfcActivity vErrorText.setText(error + "\n\n" + getString(R.string.security_token_nfc_try_again_text)); vAnimator.setDisplayedChild(3); + + nfcGuideView.setVisibility(View.GONE); } @Override |