diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java index 2b56dd3a7..5c2bc76d0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java @@ -261,7 +261,7 @@ public class KeyFormattingUtils { * @param idHex - the key id * @return - the beautified form */ - public static SpannableString beautifyKeyId(String idHex) { + public static String beautifyKeyId(String idHex) { if (idHex.startsWith("0x")) { idHex = idHex.substring(2); } @@ -276,9 +276,7 @@ public class KeyFormattingUtils { idHex = sb.toString(); } - SpannableString ss = new SpannableString(idHex); - ss.setSpan(new TypefaceSpan("monospace"), 0, idHex.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - return ss; + return idHex; } /** @@ -288,19 +286,15 @@ public class KeyFormattingUtils { * @param keyId - the key id * @return - the beautified form */ - public static SpannableString beautifyKeyId(long keyId) { + public static String beautifyKeyId(long keyId) { return beautifyKeyId(convertKeyIdToHex(keyId)); } - public static SpannableStringBuilder beautifyKeyIdWithPrefix(Context context, String idHex) { - SpannableStringBuilder ssb = new SpannableStringBuilder(); - ssb.append("ID"); - ssb.append(": "); - ssb.append(beautifyKeyId(idHex)); - return ssb; + public static String beautifyKeyIdWithPrefix(Context context, String idHex) { + return "ID: " + beautifyKeyId(idHex); } - public static SpannableStringBuilder beautifyKeyIdWithPrefix(Context context, long keyId) { + public static String beautifyKeyIdWithPrefix(Context context, long keyId) { return beautifyKeyIdWithPrefix(context, convertKeyIdToHex(keyId)); } |