mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
no monospace for key ids
This commit is contained in:
parent
6062b5ef68
commit
da4a70c513
@ -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) {
|
||||
|
@ -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]);
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user