diff options
author | Daniel Hammann <github@honnel.de> | 2014-03-18 16:07:17 +0100 |
---|---|---|
committer | Daniel Hammann <github@honnel.de> | 2014-03-18 16:33:49 +0100 |
commit | 2d3f47eb99c18b188ed6e4f396605d6b0340de16 (patch) | |
tree | ebd4d010f69a27de55892b1be9049365aae05d78 /OpenPGP-Keychain | |
parent | b39d37f59c5d1633f22a45a37c7dc94d6c37d010 (diff) | |
download | open-keychain-2d3f47eb99c18b188ed6e4f396605d6b0340de16.tar.gz open-keychain-2d3f47eb99c18b188ed6e4f396605d6b0340de16.tar.bz2 open-keychain-2d3f47eb99c18b188ed6e4f396605d6b0340de16.zip |
Show revocation status in SelectPublicKeyFragment #375
Added revocation status in Key List View (graphical symbol and red coloring)
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java | 11 | ||||
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java | 13 | ||||
-rw-r--r-- | OpenPGP-Keychain/src/main/res/drawable-hdpi/revoked_key_small.png | bin | 0 -> 2509 bytes | |||
-rw-r--r-- | OpenPGP-Keychain/src/main/res/drawable/revoked_key_small.png | bin | 0 -> 1793 bytes | |||
-rw-r--r-- | OpenPGP-Keychain/src/main/res/layout/view_key_keys_item.xml | 4 |
5 files changed, 22 insertions, 6 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index eeb17fea2..7ff4e0c57 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -192,8 +192,8 @@ public class ViewKeyMainFragment extends Fragment implements KeychainContract.Keys.IS_MASTER_KEY, KeychainContract.Keys.ALGORITHM, KeychainContract.Keys.KEY_SIZE, KeychainContract.Keys.CAN_CERTIFY, KeychainContract.Keys.CAN_SIGN, KeychainContract.Keys.CAN_ENCRYPT, - KeychainContract.Keys.CREATION, KeychainContract.Keys.EXPIRY, - KeychainContract.Keys.FINGERPRINT}; + KeychainContract.Keys.IS_REVOKED, KeychainContract.Keys.CREATION, + KeychainContract.Keys.EXPIRY, KeychainContract.Keys.FINGERPRINT}; static final String KEYS_SORT_ORDER = KeychainContract.Keys.RANK + " ASC"; static final int KEYS_INDEX_ID = 0; static final int KEYS_INDEX_KEY_ID = 1; @@ -203,9 +203,10 @@ public class ViewKeyMainFragment extends Fragment implements static final int KEYS_INDEX_CAN_CERTIFY = 5; static final int KEYS_INDEX_CAN_SIGN = 6; static final int KEYS_INDEX_CAN_ENCRYPT = 7; - static final int KEYS_INDEX_CREATION = 8; - static final int KEYS_INDEX_EXPIRY = 9; - static final int KEYS_INDEX_FINGERPRINT = 10; + static final int KEYS_INDEX_IS_REVOKED = 8; + static final int KEYS_INDEX_CREATION = 9; + static final int KEYS_INDEX_EXPIRY = 10; + static final int KEYS_INDEX_FINGERPRINT = 11; public Loader<Cursor> onCreateLoader(int id, Bundle args) { switch (id) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java index 153a3f266..5f911275d 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui.adapter; import android.content.Context; import android.database.Cursor; +import android.graphics.Color; import android.support.v4.widget.CursorAdapter; import android.view.LayoutInflater; import android.view.View; @@ -39,6 +40,7 @@ public class ViewKeyKeysAdapter extends CursorAdapter { private int mIndexCanCertify; private int mIndexCanEncrypt; private int mIndexCanSign; + private int mIndexRevokedKey; public ViewKeyKeysAdapter(Context context, Cursor c, int flags) { super(context, c, flags); @@ -70,6 +72,7 @@ public class ViewKeyKeysAdapter extends CursorAdapter { mIndexCanCertify = cursor.getColumnIndexOrThrow(Keys.CAN_CERTIFY); mIndexCanEncrypt = cursor.getColumnIndexOrThrow(Keys.CAN_ENCRYPT); mIndexCanSign = cursor.getColumnIndexOrThrow(Keys.CAN_SIGN); + mIndexRevokedKey = cursor.getColumnIndexOrThrow(Keys.IS_REVOKED); } } @@ -81,13 +84,13 @@ public class ViewKeyKeysAdapter extends CursorAdapter { ImageView certifyIcon = (ImageView) view.findViewById(R.id.ic_certifyKey); ImageView encryptIcon = (ImageView) view.findViewById(R.id.ic_encryptKey); ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey); + ImageView revokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey); String keyIdStr = PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId)); String algorithmStr = PgpKeyHelper.getAlgorithmInfo(cursor.getInt(mIndexAlgorithm), cursor.getInt(mIndexKeySize)); keyId.setText(keyIdStr); - keyDetails.setText("(" + algorithmStr + ")"); if (cursor.getInt(mIndexIsMasterKey) != 1) { @@ -113,6 +116,14 @@ public class ViewKeyKeysAdapter extends CursorAdapter { } else { signIcon.setVisibility(View.VISIBLE); } + + if (cursor.getInt(mIndexRevokedKey) > 0) { + revokedKeyIcon.setVisibility(View.VISIBLE); + keyId.setTextColor(Color.RED); + keyDetails.setTextColor(Color.RED); + } else { + revokedKeyIcon.setVisibility(View.GONE); + } } @Override diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/revoked_key_small.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/revoked_key_small.png Binary files differnew file mode 100644 index 000000000..75f45eb54 --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/drawable-hdpi/revoked_key_small.png diff --git a/OpenPGP-Keychain/src/main/res/drawable/revoked_key_small.png b/OpenPGP-Keychain/src/main/res/drawable/revoked_key_small.png Binary files differnew file mode 100644 index 000000000..f9ed0596f --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/drawable/revoked_key_small.png diff --git a/OpenPGP-Keychain/src/main/res/layout/view_key_keys_item.xml b/OpenPGP-Keychain/src/main/res/layout/view_key_keys_item.xml index 9e4bc70eb..235949ce2 100644 --- a/OpenPGP-Keychain/src/main/res/layout/view_key_keys_item.xml +++ b/OpenPGP-Keychain/src/main/res/layout/view_key_keys_item.xml @@ -40,6 +40,10 @@ android:paddingBottom="2dip" android:paddingTop="2dip" > + <ImageView android:id="@+id/ic_revokedKey" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/revoked_key_small"/> <ImageView android:id="@+id/ic_certifyKey" android:layout_width="wrap_content" |