diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 609ac8ab7..8a516e6af 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -300,13 +300,12 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn // file if (mOutputUris.size() == 1) { sendIntent = new Intent(Intent.ACTION_SEND); - sendIntent.setType("*/*"); sendIntent.putExtra(Intent.EXTRA_STREAM, mOutputUris.get(0)); } else { sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE); - sendIntent.setType("*/*"); sendIntent.putExtra(Intent.EXTRA_STREAM, mOutputUris); } + sendIntent.setType("application/pgp-encrypted"); } if (!isModeSymmetric() && mEncryptionUserIds != null) { Set users = new HashSet(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java index 2295183a9..ed3be0e7f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java @@ -40,6 +40,7 @@ import com.tokenautocomplete.TokenCompleteTextView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing; @@ -261,8 +262,9 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi @Override public void bindView(View view, Context context, Cursor cursor) { - ((TextView) view.findViewById(android.R.id.text1)).setText(cursor.getString(mIndexUserId)); - view.findViewById(android.R.id.text2).setVisibility(View.VISIBLE); + String[] userId = KeyRing.splitUserId(cursor.getString(mIndexUserId)); + ((TextView) view.findViewById(android.R.id.title)).setText(userId[2] == null ? userId[0] : (userId[0] + " (" + userId[2] + ")")); + ((TextView) view.findViewById(android.R.id.text1)).setText(userId[1]); ((TextView) view.findViewById(android.R.id.text2)).setText(PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId))); } @@ -309,19 +311,29 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi @Override public View getView(int position, View convertView, ViewGroup parent) { + View v = getDropDownView(position, convertView, parent); + v.findViewById(android.R.id.text1).setVisibility(View.GONE); + return v; + } + + @Override + public View getDropDownView(int position, View convertView, ViewGroup parent) { + View v; if (position == 0) { - View v; if (convertView == null) { v = inner.newView(null, null, parent); } else { v = convertView; } - ((TextView) v.findViewById(android.R.id.text1)).setText("None"); + ((TextView) v.findViewById(android.R.id.title)).setText("None"); + v.findViewById(android.R.id.text1).setVisibility(View.GONE); v.findViewById(android.R.id.text2).setVisibility(View.GONE); - return v; } else { - return inner.getView(position - 1, convertView, parent); + v = inner.getView(position - 1, convertView, parent); + v.findViewById(android.R.id.text1).setVisibility(View.VISIBLE); + v.findViewById(android.R.id.text2).setVisibility(View.VISIBLE); } + return v; } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java index 7538d2a56..7650c3954 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java @@ -245,7 +245,6 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte // Clear cache if needed for (Uri uri : new HashSet(thumbnailCache.keySet())) { if (!mEncryptInterface.getInputUris().contains(uri)) { - Log.d(Constants.TAG, "Removed thumbnail for uri: "+uri); thumbnailCache.remove(uri); } } 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 53731b278..329ef2c9b 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 @@ -130,12 +130,14 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView { } public class EncryptionKey { - private String mUserId; + private String mUserIdFull; + private String[] mUserId; private long mKeyId; private String mFingerprint; public EncryptionKey(String userId, long keyId, String fingerprint) { - this.mUserId = userId; + this.mUserId = KeyRing.splitUserId(userId); + this.mUserIdFull = userId; this.mKeyId = keyId; this.mFingerprint = fingerprint; } @@ -154,7 +156,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView { } public String getUserId() { - return mUserId; + return mUserIdFull; } public String getFingerprint() { @@ -162,25 +164,31 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView { } public String getPrimary() { - String[] userId = KeyRing.splitUserId(mUserId); - if (userId[0] != null && userId[2] != null) { - return userId[0] + " (" + userId[2] + ")"; - } else if (userId[0] != null) { - return userId[0]; + if (mUserId[0] != null && mUserId[2] != null) { + return mUserId[0] + " (" + mUserId[2] + ")"; + } else if (mUserId[0] != null) { + return mUserId[0]; } else { - return userId[1]; + return mUserId[1]; } } public String getSecondary() { - String[] userId = KeyRing.splitUserId(mUserId); - if (userId[0] != null) { - return userId[1] + " (" + getKeyIdHexShort() + ")"; + if (mUserId[0] != null) { + return mUserId[1]; } else { return getKeyIdHex(); } } + public String getTertiary() { + if (mUserId[0] != null) { + return getKeyIdHex(); + } else { + return null; + } + } + public long getKeyId() { return mKeyId; } @@ -216,6 +224,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView { } ((TextView) view.findViewById(android.R.id.title)).setText(getItem(position).getPrimary()); ((TextView) view.findViewById(android.R.id.text1)).setText(getItem(position).getSecondary()); + ((TextView) view.findViewById(android.R.id.text2)).setText(getItem(position).getTertiary()); setImageByKey((ImageView) view.findViewById(android.R.id.icon), getItem(position)); return view; } diff --git a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml index 35c618c72..703f9133b 100644 --- a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml +++ b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml @@ -3,17 +3,29 @@ - - - + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml b/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml index 2be37fb4c..9d2d1e9a9 100644 --- a/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml +++ b/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml @@ -30,11 +30,20 @@ android:singleLine="true" android:ellipsize="end" android:layout_marginTop="-4dip"/> +