diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-31 23:54:02 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-31 23:54:02 +0200 |
commit | 55b764eb1d39a8f07286454cfce952fb459b7a89 (patch) | |
tree | 04c7782b9b88bc890e64c9b4804ae13a4a32cdec /OpenKeychain/src/main/java/org | |
parent | 3451111edd7e31dd6c7c1c829ffacd2467a6891a (diff) | |
download | open-keychain-55b764eb1d39a8f07286454cfce952fb459b7a89.tar.gz open-keychain-55b764eb1d39a8f07286454cfce952fb459b7a89.tar.bz2 open-keychain-55b764eb1d39a8f07286454cfce952fb459b7a89.zip |
Show revoked and expired for private keys
Diffstat (limited to 'OpenKeychain/src/main/java/org')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index b0caaa10c..96e21da52 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -475,41 +475,40 @@ public class KeyListFragment extends LoaderFragment } } - { // set edit button and revoked info, specific by key type - - if (cursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { - // this is a secret key - h.mStatus.setVisibility(View.GONE); - } else { - // this is a public key - show if it's revoked, expired, or verified - - boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0; - boolean isExpired = !cursor.isNull(INDEX_EXPIRY) - && new Date(cursor.getLong(INDEX_EXPIRY)*1000).before(new Date()); - boolean isVerified = cursor.getInt(INDEX_VERIFIED) > 0; - - // Note: order is important! - if (isRevoked) { - h.mStatus.setImageDrawable( - getResources().getDrawable(R.drawable.status_signature_revoked_cutout)); - h.mStatus.setColorFilter(getResources().getColor(R.color.android_red_light), - PorterDuff.Mode.SRC_ATOP); - h.mStatus.setVisibility(View.VISIBLE); - } else if (isExpired) { - h.mStatus.setImageDrawable( - getResources().getDrawable(R.drawable.status_signature_expired_cutout)); - h.mStatus.setColorFilter(getResources().getColor(R.color.android_orange_light), - PorterDuff.Mode.SRC_ATOP); - h.mStatus.setVisibility(View.VISIBLE); - } else if (isVerified) { + { // set edit button and status, specific by key type + + boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0; + boolean isExpired = !cursor.isNull(INDEX_EXPIRY) + && new Date(cursor.getLong(INDEX_EXPIRY)*1000).before(new Date()); + boolean isVerified = cursor.getInt(INDEX_VERIFIED) > 0; + + // Note: order is important! + if (isRevoked) { + h.mStatus.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_revoked_cutout)); + h.mStatus.setColorFilter(getResources().getColor(R.color.android_red_light), + PorterDuff.Mode.SRC_ATOP); + h.mStatus.setVisibility(View.VISIBLE); + } else if (isExpired) { + h.mStatus.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_expired_cutout)); + h.mStatus.setColorFilter(getResources().getColor(R.color.android_orange_light), + PorterDuff.Mode.SRC_ATOP); + h.mStatus.setVisibility(View.VISIBLE); + } else if (isVerified) { + if (cursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { + // this is a secret key + h.mStatus.setVisibility(View.GONE); + } else { + // this is a public key - show if it's verified h.mStatus.setImageDrawable( getResources().getDrawable(R.drawable.status_signature_verified_cutout)); h.mStatus.setColorFilter(getResources().getColor(R.color.android_green_light), PorterDuff.Mode.SRC_ATOP); h.mStatus.setVisibility(View.VISIBLE); - } else { - h.mStatus.setVisibility(View.GONE); } + } else { + h.mStatus.setVisibility(View.GONE); } } |