aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java39
1 files changed, 32 insertions, 7 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index 096dea51f..87539ea05 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -116,6 +116,21 @@ public class SubkeysAdapter extends CursorAdapter {
}
}
+ public int getAlgorithm(int position) {
+ mCursor.moveToPosition(position);
+ return mCursor.getInt(INDEX_ALGORITHM);
+ }
+
+ public int getKeySize(int position) {
+ mCursor.moveToPosition(position);
+ return mCursor.getInt(INDEX_KEY_SIZE);
+ }
+
+ public SecretKeyType getSecretKeyType(int position) {
+ mCursor.moveToPosition(position);
+ return SecretKeyType.fromNum(mCursor.getInt(INDEX_HAS_SECRET));
+ }
+
@Override
public Cursor swapCursor(Cursor newCursor) {
hasAnySecret = false;
@@ -164,13 +179,23 @@ public class SubkeysAdapter extends CursorAdapter {
? mSaveKeyringParcel.getSubkeyChange(keyId)
: null;
- if (change != null && change.mDummyStrip) {
- algorithmStr.append(", ");
- final SpannableString boldStripped = new SpannableString(
- context.getString(R.string.key_stripped)
- );
- boldStripped.setSpan(new StyleSpan(Typeface.BOLD), 0, boldStripped.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- algorithmStr.append(boldStripped);
+ if (change != null && (change.mDummyStrip || change.mMoveKeyToCard)) {
+ if (change.mDummyStrip) {
+ algorithmStr.append(", ");
+ final SpannableString boldStripped = new SpannableString(
+ context.getString(R.string.key_stripped)
+ );
+ boldStripped.setSpan(new StyleSpan(Typeface.BOLD), 0, boldStripped.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ algorithmStr.append(boldStripped);
+ }
+ if (change.mMoveKeyToCard) {
+ algorithmStr.append(", ");
+ final SpannableString boldDivert = new SpannableString(
+ context.getString(R.string.key_divert)
+ );
+ boldDivert.setSpan(new StyleSpan(Typeface.BOLD), 0, boldDivert.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ algorithmStr.append(boldDivert);
+ }
} else {
switch (SecretKeyType.fromNum(cursor.getInt(INDEX_HAS_SECRET))) {
case GNU_DUMMY: