diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-05-06 15:04:09 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-05-06 15:04:09 +0200 |
commit | f91457e07fd3f38ba5cd4d07bb0b708a3a5beb17 (patch) | |
tree | 4d3309031cb5eefd32e8e90a9f807722a0f9dd1d /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | 8564c4aca15f3dff339063054e137602dff42567 (diff) | |
download | open-keychain-f91457e07fd3f38ba5cd4d07bb0b708a3a5beb17.tar.gz open-keychain-f91457e07fd3f38ba5cd4d07bb0b708a3a5beb17.tar.bz2 open-keychain-f91457e07fd3f38ba5cd4d07bb0b708a3a5beb17.zip |
Touch view only once
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index 46c726ac3..ded457eca 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -204,26 +204,28 @@ public class ViewKeyMainFragment extends Fragment implements mActionEditDivider.setVisibility(View.GONE); } - // It's easier to reset to defaults beforehand, saves some nasty else clauses - mStatusRevoked.setVisibility(View.GONE); - mStatusExpired.setVisibility(View.GONE); - mActionCertify.setEnabled(true); - mActionEdit.setEnabled(true); - mActionEncrypt.setEnabled(true); - // If this key is revoked, it cannot be used for anything! if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) { mStatusRevoked.setVisibility(View.VISIBLE); - mActionCertify.setEnabled(false); + mStatusExpired.setVisibility(View.GONE); + mActionEdit.setEnabled(false); + mActionCertify.setEnabled(false); mActionEncrypt.setEnabled(false); } else { + mActionEdit.setEnabled(true); + Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000); if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) { + mStatusRevoked.setVisibility(View.GONE); mStatusExpired.setVisibility(View.VISIBLE); mActionCertify.setEnabled(false); mActionEncrypt.setEnabled(false); - // mActionEdit is still fine + } else { + mStatusRevoked.setVisibility(View.GONE); + mStatusExpired.setVisibility(View.GONE); + mActionCertify.setEnabled(true); + mActionEncrypt.setEnabled(true); } } |