diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-15 12:48:54 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-15 12:48:54 +0200 |
commit | be9b483ee877779a905de965c6b88fb47332b069 (patch) | |
tree | d238e77c78ee1869ec71b312f129d4bd79bdcd7c /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java | |
parent | c7e2b8424e2c833015dd390ba6fd21f71957858b (diff) | |
download | open-keychain-be9b483ee877779a905de965c6b88fb47332b069.tar.gz open-keychain-be9b483ee877779a905de965c6b88fb47332b069.tar.bz2 open-keychain-be9b483ee877779a905de965c6b88fb47332b069.zip |
color experiments
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java index 6bea20168..55ed7c65b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java @@ -37,6 +37,7 @@ import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.provider.KeychainContract.Certs; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; +import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import java.util.ArrayList; @@ -163,10 +164,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC if (isRevoked) { // set revocation icon (can this even be primary?) - vVerified.setImageResource(R.drawable.status_signature_revoked_cutout); - vVerified.setColorFilter( - mContext.getResources().getColor(R.color.bg_gray), - PorterDuff.Mode.SRC_IN); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_REVOKED, true); // disable and strike through text for revoked user ids vName.setEnabled(false); @@ -191,22 +189,13 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC int isVerified = cursor.getInt(INDEX_VERIFIED); switch (isVerified) { case Certs.VERIFIED_SECRET: - vVerified.setImageResource(R.drawable.status_signature_verified_cutout); - vVerified.setColorFilter( - mContext.getResources().getColor(R.color.android_green_dark), - PorterDuff.Mode.SRC_IN); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_VERIFIED, false); break; case Certs.VERIFIED_SELF: - vVerified.setImageResource(R.drawable.status_signature_unverified_cutout); - vVerified.setColorFilter( - mContext.getResources().getColor(R.color.bg_gray), - PorterDuff.Mode.SRC_IN); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_UNVERIFIED, false); break; default: - vVerified.setImageResource(R.drawable.status_signature_invalid_cutout); - vVerified.setColorFilter( - mContext.getResources().getColor(R.color.android_red_dark), - PorterDuff.Mode.SRC_IN); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_INVALID, false); break; } } |