diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-05 22:06:09 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-05 22:06:09 +0200 |
commit | 162cb1cb7b6e3908716a6e874b6bcba4b3d825e3 (patch) | |
tree | a872afbbdaff9c04f77a34d2b4ea19907d4d10aa /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | 0fe08233723e46ec966919cf358a30d6c289375e (diff) | |
download | open-keychain-162cb1cb7b6e3908716a6e874b6bcba4b3d825e3.tar.gz open-keychain-162cb1cb7b6e3908716a6e874b6bcba4b3d825e3.tar.bz2 open-keychain-162cb1cb7b6e3908716a6e874b6bcba4b3d825e3.zip |
ui: subkey view redesign
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java index 9e26e559f..f4942a2a0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java @@ -121,35 +121,17 @@ public class ViewKeyKeysAdapter extends CursorAdapter { keyId.setText(keyIdStr); // may be set with additional "stripped" later on if (hasAnySecret && cursor.getInt(mIndexHasSecret) == 0) { - keyDetails.setText("(" + algorithmStr + ", " + - context.getString(R.string.key_stripped) + ")"); + keyDetails.setText(algorithmStr + ", " + + context.getString(R.string.key_stripped)); } else { - keyDetails.setText("(" + algorithmStr + ")"); + keyDetails.setText(algorithmStr); } - if (cursor.getInt(mIndexRank) == 0) { - masterKeyIcon.setVisibility(View.INVISIBLE); - } else { - masterKeyIcon.setVisibility(View.VISIBLE); - } - - if (cursor.getInt(mIndexCanCertify) != 1) { - certifyIcon.setVisibility(View.GONE); - } else { - certifyIcon.setVisibility(View.VISIBLE); - } - - if (cursor.getInt(mIndexCanEncrypt) != 1) { - encryptIcon.setVisibility(View.GONE); - } else { - encryptIcon.setVisibility(View.VISIBLE); - } - - if (cursor.getInt(mIndexCanSign) != 1) { - signIcon.setVisibility(View.GONE); - } else { - signIcon.setVisibility(View.VISIBLE); - } + // Set icons according to properties + masterKeyIcon.setVisibility(cursor.getInt(mIndexRank) == 0 ? View.VISIBLE : View.INVISIBLE); + certifyIcon.setVisibility(cursor.getInt(mIndexCanCertify) != 0 ? View.VISIBLE : View.GONE); + encryptIcon.setVisibility(cursor.getInt(mIndexCanEncrypt) != 0 ? View.VISIBLE : View.GONE); + signIcon.setVisibility(cursor.getInt(mIndexCanSign) != 0 ? View.VISIBLE : View.GONE); boolean valid = true; if (cursor.getInt(mIndexRevokedKey) > 0) { @@ -168,13 +150,13 @@ public class ViewKeyKeysAdapter extends CursorAdapter { Date expiryDate = new Date(cursor.getLong(mIndexExpiry) * 1000); valid = valid && expiryDate.after(new Date()); - keyExpiry.setText("(" + + keyExpiry.setText( context.getString(R.string.label_expiry) + ": " + - DateFormat.getDateFormat(context).format(expiryDate) + ")"); - - keyExpiry.setVisibility(View.VISIBLE); + DateFormat.getDateFormat(context).format(expiryDate)); } else { - keyExpiry.setVisibility(View.GONE); + keyExpiry.setText( + context.getString(R.string.label_expiry) + ": " + + context.getString(R.string.none)); } // if key is expired or revoked, strike through text |