aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java6
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java2
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java18
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java8
4 files changed, 13 insertions, 21 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
index dce02b105..b0e641778 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
@@ -121,8 +121,7 @@ public class ViewCertActivity extends ActionBarActivity
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
if (data.moveToFirst()) {
- SpannableString signeeKey = KeyFormattingUtils.beautifyKeyId(data.getLong(INDEX_MASTER_KEY_ID));
- mSigneeKey.setText(signeeKey);
+ mSigneeKey.setText(KeyFormattingUtils.beautifyKeyId(data.getLong(INDEX_MASTER_KEY_ID)));
String signeeUid = data.getString(INDEX_USER_ID);
mSigneeUid.setText(signeeUid);
@@ -131,8 +130,7 @@ public class ViewCertActivity extends ActionBarActivity
mCreation.setText(DateFormat.getDateFormat(getApplicationContext()).format(creationDate));
mCertifierKeyId = data.getLong(INDEX_KEY_ID_CERTIFIER);
- SpannableString certifierKey = KeyFormattingUtils.beautifyKeyId(mCertifierKeyId);
- mCertifierKey.setText(certifierKey);
+ mCertifierKey.setText(KeyFormattingUtils.beautifyKeyId(mCertifierKeyId));
String certifierUid = data.getString(INDEX_SIGNER_UID);
if (certifierUid != null) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
index 03b065ae5..6b1cee221 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
@@ -220,7 +220,7 @@ public class ViewKeyCertsFragment extends LoaderFragment
TextView wSignerName = (TextView) view.findViewById(R.id.signerName);
TextView wSignStatus = (TextView) view.findViewById(R.id.signStatus);
- SpannableStringBuilder signerKeyId = KeyFormattingUtils.beautifyKeyIdWithPrefix(getActivity(), cursor.getLong(mIndexSignerKeyId));
+ String signerKeyId = KeyFormattingUtils.beautifyKeyIdWithPrefix(getActivity(), cursor.getLong(mIndexSignerKeyId));
String[] userId = KeyRing.splitUserId(cursor.getString(mIndexSignerUserId));
if (userId[0] != null) {
wSignerName.setText(userId[0]);
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));
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 30e032736..08599333a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -219,15 +219,15 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
}
- public SpannableStringBuilder getSecondary() {
+ public String getSecondary() {
if (mUserId[1] != null) {
- return new SpannableStringBuilder(mUserId[1]);
+ return mUserId[1];
} else {
return getKeyIdHex();
}
}
- public SpannableStringBuilder getTertiary() {
+ public String getTertiary() {
if (mUserId[0] != null) {
return getKeyIdHex();
} else {
@@ -239,7 +239,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
return mKeyId;
}
- public SpannableStringBuilder getKeyIdHex() {
+ public String getKeyIdHex() {
return KeyFormattingUtils.beautifyKeyIdWithPrefix(getContext(), mKeyId);
}