Merge pull request #1564 from open-keychain/v/decrypt-key-lookup
key lookup improvements
This commit is contained in:
@@ -72,10 +72,14 @@ import org.openintents.openpgp.OpenPgpSignatureResult;
|
|||||||
import org.sufficientlysecure.keychain.BuildConfig;
|
import org.sufficientlysecure.keychain.BuildConfig;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
|
||||||
|
import org.sufficientlysecure.keychain.operations.results.ImportKeyResult;
|
||||||
import org.sufficientlysecure.keychain.operations.results.InputDataResult;
|
import org.sufficientlysecure.keychain.operations.results.InputDataResult;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyInputParcel;
|
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyInputParcel;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
|
import org.sufficientlysecure.keychain.service.ImportKeyringParcel;
|
||||||
import org.sufficientlysecure.keychain.service.InputDataParcel;
|
import org.sufficientlysecure.keychain.service.InputDataParcel;
|
||||||
|
import org.sufficientlysecure.keychain.ui.base.CryptoOperationHelper;
|
||||||
import org.sufficientlysecure.keychain.ui.base.QueueingCryptoOperationFragment;
|
import org.sufficientlysecure.keychain.ui.base.QueueingCryptoOperationFragment;
|
||||||
// this import NEEDS to be above the ViewModel AND SubViewHolder one, or it won't compile! (as of 16.09.15)
|
// this import NEEDS to be above the ViewModel AND SubViewHolder one, or it won't compile! (as of 16.09.15)
|
||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.StatusHolder;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.StatusHolder;
|
||||||
@@ -89,6 +93,7 @@ import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
|||||||
import org.sufficientlysecure.keychain.util.FileHelper;
|
import org.sufficientlysecure.keychain.util.FileHelper;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.ParcelableHashMap;
|
import org.sufficientlysecure.keychain.util.ParcelableHashMap;
|
||||||
|
import org.sufficientlysecure.keychain.util.Preferences;
|
||||||
|
|
||||||
|
|
||||||
/** Displays a list of decrypted inputs.
|
/** Displays a list of decrypted inputs.
|
||||||
@@ -467,8 +472,9 @@ public class DecryptListFragment
|
|||||||
|
|
||||||
// un-cancel this one
|
// un-cancel this one
|
||||||
mCancelledInputUris.remove(uri);
|
mCancelledInputUris.remove(uri);
|
||||||
|
mInputDataResults.remove(uri);
|
||||||
mPendingInputUris.add(uri);
|
mPendingInputUris.add(uri);
|
||||||
mAdapter.setCancelled(uri, false);
|
mAdapter.resetItemData(uri);
|
||||||
|
|
||||||
// check if there are any pending input uris
|
// check if there are any pending input uris
|
||||||
cryptoOperation();
|
cryptoOperation();
|
||||||
@@ -729,6 +735,66 @@ public class DecryptListFragment
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void lookupUnknownKey(final Uri inputUri, long unknownKeyId) {
|
||||||
|
|
||||||
|
final ArrayList<ParcelableKeyRing> keyList;
|
||||||
|
final String keyserver;
|
||||||
|
|
||||||
|
// search config
|
||||||
|
{
|
||||||
|
Preferences prefs = Preferences.getPreferences(getActivity());
|
||||||
|
Preferences.CloudSearchPrefs cloudPrefs =
|
||||||
|
new Preferences.CloudSearchPrefs(true, true, prefs.getPreferredKeyserver());
|
||||||
|
keyserver = cloudPrefs.keyserver;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ParcelableKeyRing keyEntry = new ParcelableKeyRing(null,
|
||||||
|
KeyFormattingUtils.convertKeyIdToHex(unknownKeyId), null);
|
||||||
|
ArrayList<ParcelableKeyRing> selectedEntries = new ArrayList<>();
|
||||||
|
selectedEntries.add(keyEntry);
|
||||||
|
|
||||||
|
keyList = selectedEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
CryptoOperationHelper.Callback<ImportKeyringParcel, ImportKeyResult> callback
|
||||||
|
= new CryptoOperationHelper.Callback<ImportKeyringParcel, ImportKeyResult>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ImportKeyringParcel createOperationInput() {
|
||||||
|
return new ImportKeyringParcel(keyList, keyserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCryptoOperationSuccess(ImportKeyResult result) {
|
||||||
|
retryUri(inputUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCryptoOperationCancelled() {
|
||||||
|
mAdapter.setProcessingKeyLookup(inputUri, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCryptoOperationError(ImportKeyResult result) {
|
||||||
|
result.createNotify(getActivity()).show();
|
||||||
|
mAdapter.setProcessingKeyLookup(inputUri, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCryptoSetProgress(String msg, int progress, int max) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mAdapter.setProcessingKeyLookup(inputUri, true);
|
||||||
|
|
||||||
|
CryptoOperationHelper importOpHelper = new CryptoOperationHelper<>(2, this, callback, null);
|
||||||
|
importOpHelper.cryptoOperation();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void deleteFile(Activity activity, Uri uri) {
|
private void deleteFile(Activity activity, Uri uri) {
|
||||||
|
|
||||||
// we can only ever delete a file once, if we got this far either it's gone or it will never work
|
// we can only ever delete a file once, if we got this far either it's gone or it will never work
|
||||||
@@ -774,6 +840,7 @@ public class DecryptListFragment
|
|||||||
int mProgress, mMax;
|
int mProgress, mMax;
|
||||||
String mProgressMsg;
|
String mProgressMsg;
|
||||||
OnClickListener mCancelled;
|
OnClickListener mCancelled;
|
||||||
|
boolean mProcessingKeyLookup;
|
||||||
|
|
||||||
ViewModel(Uri uri) {
|
ViewModel(Uri uri) {
|
||||||
mInputUri = uri;
|
mInputUri = uri;
|
||||||
@@ -782,7 +849,7 @@ public class DecryptListFragment
|
|||||||
mCancelled = null;
|
mCancelled = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addResult(InputDataResult result) {
|
void setResult(InputDataResult result) {
|
||||||
mResult = result;
|
mResult = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,6 +869,10 @@ public class DecryptListFragment
|
|||||||
mMax = max;
|
mMax = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setProcessingKeyLookup(boolean processingKeyLookup) {
|
||||||
|
mProcessingKeyLookup = processingKeyLookup;
|
||||||
|
}
|
||||||
|
|
||||||
// Depends on inputUri only
|
// Depends on inputUri only
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
@@ -870,17 +941,13 @@ public class DecryptListFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bindItemCancelled(ViewHolder holder, ViewModel model) {
|
private void bindItemCancelled(ViewHolder holder, ViewModel model) {
|
||||||
if (holder.vAnimator.getDisplayedChild() != 3) {
|
holder.vAnimator.setDisplayedChild(3);
|
||||||
holder.vAnimator.setDisplayedChild(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.vCancelledRetry.setOnClickListener(model.mCancelled);
|
holder.vCancelledRetry.setOnClickListener(model.mCancelled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindItemProgress(ViewHolder holder, ViewModel model) {
|
private void bindItemProgress(ViewHolder holder, ViewModel model) {
|
||||||
if (holder.vAnimator.getDisplayedChild() != 0) {
|
holder.vAnimator.setDisplayedChild(0);
|
||||||
holder.vAnimator.setDisplayedChild(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.vProgress.setProgress(model.mProgress);
|
holder.vProgress.setProgress(model.mProgress);
|
||||||
holder.vProgress.setMax(model.mMax);
|
holder.vProgress.setMax(model.mMax);
|
||||||
@@ -890,11 +957,10 @@ public class DecryptListFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bindItemSuccess(ViewHolder holder, final ViewModel model) {
|
private void bindItemSuccess(ViewHolder holder, final ViewModel model) {
|
||||||
if (holder.vAnimator.getDisplayedChild() != 1) {
|
holder.vAnimator.setDisplayedChild(1);
|
||||||
holder.vAnimator.setDisplayedChild(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyFormattingUtils.setStatus(getResources(), holder, model.mResult.mDecryptVerifyResult);
|
KeyFormattingUtils.setStatus(getResources(), holder,
|
||||||
|
model.mResult.mDecryptVerifyResult, model.mProcessingKeyLookup);
|
||||||
|
|
||||||
int numFiles = model.mResult.getOutputUris().size();
|
int numFiles = model.mResult.getOutputUris().size();
|
||||||
holder.resizeFileList(numFiles, LayoutInflater.from(getActivity()));
|
holder.resizeFileList(numFiles, LayoutInflater.from(getActivity()));
|
||||||
@@ -972,6 +1038,13 @@ public class DecryptListFragment
|
|||||||
activity.startActivity(intent);
|
activity.startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
holder.vSignatureLayout.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
lookupUnknownKey(model.mInputUri, keyId);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1000,9 +1073,7 @@ public class DecryptListFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bindItemFailure(ViewHolder holder, final ViewModel model) {
|
private void bindItemFailure(ViewHolder holder, final ViewModel model) {
|
||||||
if (holder.vAnimator.getDisplayedChild() != 2) {
|
holder.vAnimator.setDisplayedChild(2);
|
||||||
holder.vAnimator.setDisplayedChild(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.vErrorMsg.setText(model.mResult.getLog().getLast().mType.getMsgId());
|
holder.vErrorMsg.setText(model.mResult.getLog().getLast().mType.getMsgId());
|
||||||
|
|
||||||
@@ -1067,14 +1138,28 @@ public class DecryptListFragment
|
|||||||
notifyItemChanged(pos);
|
notifyItemChanged(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addResult(Uri uri, InputDataResult result) {
|
public void setProcessingKeyLookup(Uri uri, boolean processingKeyLookup) {
|
||||||
|
ViewModel newModel = new ViewModel(uri);
|
||||||
|
int pos = mDataset.indexOf(newModel);
|
||||||
|
mDataset.get(pos).setProcessingKeyLookup(processingKeyLookup);
|
||||||
|
notifyItemChanged(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addResult(Uri uri, InputDataResult result) {
|
||||||
ViewModel model = new ViewModel(uri);
|
ViewModel model = new ViewModel(uri);
|
||||||
int pos = mDataset.indexOf(model);
|
int pos = mDataset.indexOf(model);
|
||||||
model = mDataset.get(pos);
|
model = mDataset.get(pos);
|
||||||
|
model.setResult(result);
|
||||||
|
notifyItemChanged(pos);
|
||||||
|
}
|
||||||
|
|
||||||
model.addResult(result);
|
public void resetItemData(Uri uri) {
|
||||||
|
ViewModel model = new ViewModel(uri);
|
||||||
|
int pos = mDataset.indexOf(model);
|
||||||
|
model = mDataset.get(pos);
|
||||||
|
model.setResult(null);
|
||||||
|
model.setCancelled(null);
|
||||||
|
model.setProcessingKeyLookup(false);
|
||||||
notifyItemChanged(pos);
|
notifyItemChanged(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,7 +1183,7 @@ public class DecryptListFragment
|
|||||||
public View vSignatureLayout;
|
public View vSignatureLayout;
|
||||||
public TextView vSignatureName;
|
public TextView vSignatureName;
|
||||||
public TextView vSignatureMail;
|
public TextView vSignatureMail;
|
||||||
public TextView vSignatureAction;
|
public ViewAnimator vSignatureAction;
|
||||||
public View vContextMenu;
|
public View vContextMenu;
|
||||||
|
|
||||||
public TextView vErrorMsg;
|
public TextView vErrorMsg;
|
||||||
@@ -1141,7 +1226,7 @@ public class DecryptListFragment
|
|||||||
vSignatureLayout = itemView.findViewById(R.id.result_signature_layout);
|
vSignatureLayout = itemView.findViewById(R.id.result_signature_layout);
|
||||||
vSignatureName = (TextView) itemView.findViewById(R.id.result_signature_name);
|
vSignatureName = (TextView) itemView.findViewById(R.id.result_signature_name);
|
||||||
vSignatureMail= (TextView) itemView.findViewById(R.id.result_signature_email);
|
vSignatureMail= (TextView) itemView.findViewById(R.id.result_signature_email);
|
||||||
vSignatureAction = (TextView) itemView.findViewById(R.id.result_signature_action);
|
vSignatureAction = (ViewAnimator) itemView.findViewById(R.id.result_signature_action);
|
||||||
|
|
||||||
vFileList = (LinearLayout) itemView.findViewById(R.id.file_list);
|
vFileList = (LinearLayout) itemView.findViewById(R.id.file_list);
|
||||||
for (int i = 0; i < vFileList.getChildCount(); i++) {
|
for (int i = 0; i < vFileList.getChildCount(); i++) {
|
||||||
@@ -1205,7 +1290,7 @@ public class DecryptListFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextView getSignatureAction() {
|
public ViewAnimator getSignatureAction() {
|
||||||
return vSignatureAction;
|
return vSignatureAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import android.text.style.ForegroundColorSpan;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.ViewAnimator;
|
||||||
|
|
||||||
import org.openintents.openpgp.OpenPgpDecryptionResult;
|
import org.openintents.openpgp.OpenPgpDecryptionResult;
|
||||||
import org.openintents.openpgp.OpenPgpSignatureResult;
|
import org.openintents.openpgp.OpenPgpSignatureResult;
|
||||||
@@ -440,14 +441,15 @@ public class KeyFormattingUtils {
|
|||||||
View getSignatureLayout();
|
View getSignatureLayout();
|
||||||
TextView getSignatureUserName();
|
TextView getSignatureUserName();
|
||||||
TextView getSignatureUserEmail();
|
TextView getSignatureUserEmail();
|
||||||
TextView getSignatureAction();
|
ViewAnimator getSignatureAction();
|
||||||
|
|
||||||
boolean hasEncrypt();
|
boolean hasEncrypt();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // context.getDrawable is api lvl 21, need to use deprecated
|
@SuppressWarnings("deprecation") // context.getDrawable is api lvl 21, need to use deprecated
|
||||||
public static void setStatus(Resources resources, StatusHolder holder, DecryptVerifyResult result) {
|
public static void setStatus(Resources resources, StatusHolder holder, DecryptVerifyResult result,
|
||||||
|
boolean processingkeyLookup) {
|
||||||
|
|
||||||
if (holder.hasEncrypt()) {
|
if (holder.hasEncrypt()) {
|
||||||
OpenPgpDecryptionResult decryptionResult = result.getDecryptionResult();
|
OpenPgpDecryptionResult decryptionResult = result.getDecryptionResult();
|
||||||
@@ -488,7 +490,7 @@ public class KeyFormattingUtils {
|
|||||||
OpenPgpSignatureResult signatureResult = result.getSignatureResult();
|
OpenPgpSignatureResult signatureResult = result.getSignatureResult();
|
||||||
|
|
||||||
int sigText, sigIcon, sigColor;
|
int sigText, sigIcon, sigColor;
|
||||||
int sigActionText, sigActionIcon;
|
int sigActionDisplayedChild;
|
||||||
|
|
||||||
switch (signatureResult.getResult()) {
|
switch (signatureResult.getResult()) {
|
||||||
|
|
||||||
@@ -500,8 +502,7 @@ public class KeyFormattingUtils {
|
|||||||
sigColor = R.color.key_flag_gray;
|
sigColor = R.color.key_flag_gray;
|
||||||
|
|
||||||
// won't be used, but makes compiler happy
|
// won't be used, but makes compiler happy
|
||||||
sigActionText = 0;
|
sigActionDisplayedChild = -1;
|
||||||
sigActionIcon = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,8 +511,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_verified_cutout_24dp;
|
sigIcon = R.drawable.status_signature_verified_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_green;
|
sigColor = R.color.key_flag_green;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_show;
|
sigActionDisplayedChild = 0;
|
||||||
sigActionIcon = R.drawable.ic_vpn_key_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,8 +520,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_unverified_cutout_24dp;
|
sigIcon = R.drawable.status_signature_unverified_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_orange;
|
sigColor = R.color.key_flag_orange;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_show;
|
sigActionDisplayedChild = 0;
|
||||||
sigActionIcon = R.drawable.ic_vpn_key_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,8 +529,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_revoked_cutout_24dp;
|
sigIcon = R.drawable.status_signature_revoked_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_red;
|
sigColor = R.color.key_flag_red;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_show;
|
sigActionDisplayedChild = 0;
|
||||||
sigActionIcon = R.drawable.ic_vpn_key_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,8 +538,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_expired_cutout_24dp;
|
sigIcon = R.drawable.status_signature_expired_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_red;
|
sigColor = R.color.key_flag_red;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_show;
|
sigActionDisplayedChild = 0;
|
||||||
sigActionIcon = R.drawable.ic_vpn_key_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,8 +547,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_unknown_cutout_24dp;
|
sigIcon = R.drawable.status_signature_unknown_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_red;
|
sigColor = R.color.key_flag_red;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_Lookup;
|
sigActionDisplayedChild = 1;
|
||||||
sigActionIcon = R.drawable.ic_file_download_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,8 +556,7 @@ public class KeyFormattingUtils {
|
|||||||
sigIcon = R.drawable.status_signature_invalid_cutout_24dp;
|
sigIcon = R.drawable.status_signature_invalid_cutout_24dp;
|
||||||
sigColor = R.color.key_flag_red;
|
sigColor = R.color.key_flag_red;
|
||||||
|
|
||||||
sigActionText = R.string.decrypt_result_action_show;
|
sigActionDisplayedChild = 0;
|
||||||
sigActionIcon = R.drawable.ic_vpn_key_grey_24dp;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,13 +567,17 @@ public class KeyFormattingUtils {
|
|||||||
sigColor = R.color.key_flag_red;
|
sigColor = R.color.key_flag_red;
|
||||||
|
|
||||||
// won't be used, but makes compiler happy
|
// won't be used, but makes compiler happy
|
||||||
sigActionText = 0;
|
sigActionDisplayedChild = -1;
|
||||||
sigActionIcon = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// possibly switch out "Lookup" button for progress bar
|
||||||
|
if (sigActionDisplayedChild == 1 && processingkeyLookup) {
|
||||||
|
sigActionDisplayedChild = 2;
|
||||||
|
}
|
||||||
|
|
||||||
int sigColorRes = resources.getColor(sigColor);
|
int sigColorRes = resources.getColor(sigColor);
|
||||||
holder.getSignatureStatusIcon().setColorFilter(sigColorRes, PorterDuff.Mode.SRC_IN);
|
holder.getSignatureStatusIcon().setColorFilter(sigColorRes, PorterDuff.Mode.SRC_IN);
|
||||||
holder.getSignatureStatusIcon().setImageDrawable(resources.getDrawable(sigIcon));
|
holder.getSignatureStatusIcon().setImageDrawable(resources.getDrawable(sigIcon));
|
||||||
@@ -591,9 +590,7 @@ public class KeyFormattingUtils {
|
|||||||
|
|
||||||
holder.getSignatureLayout().setVisibility(View.VISIBLE);
|
holder.getSignatureLayout().setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
holder.getSignatureAction().setText(sigActionText);
|
holder.getSignatureAction().setDisplayedChild(sigActionDisplayedChild);
|
||||||
holder.getSignatureAction().setCompoundDrawablesWithIntrinsicBounds(
|
|
||||||
0, 0, sigActionIcon, 0);
|
|
||||||
|
|
||||||
String userId = result.getSignatureResult().getPrimaryUserId();
|
String userId = result.getSignatureResult().getPrimaryUserId();
|
||||||
KeyRing.UserId userIdSplit = KeyRing.splitUserId(userId);
|
KeyRing.UserId userIdSplit = KeyRing.splitUserId(userId);
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
android:measureAllChildren="false"
|
android:measureAllChildren="false"
|
||||||
custom:initialView="1"
|
custom:initialView="1"
|
||||||
android:minHeight="?listPreferredItemHeightSmall"
|
android:minHeight="?listPreferredItemHeightSmall"
|
||||||
android:animateLayoutChanges="true"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -113,6 +112,7 @@
|
|||||||
android:id="@+id/result_signature_icon"
|
android:id="@+id/result_signature_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:src="@drawable/status_signature_unverified_cutout_24dp"
|
android:src="@drawable/status_signature_unverified_cutout_24dp"
|
||||||
/>
|
/>
|
||||||
@@ -136,6 +136,7 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:background="?android:selectableItemBackground"
|
android:background="?android:selectableItemBackground"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:minHeight="40dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -144,7 +145,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
android:gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -162,6 +163,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text=""
|
android:text=""
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
tools:text="alice@example.com" />
|
tools:text="alice@example.com" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -174,19 +177,45 @@
|
|||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<TextView
|
<org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
|
||||||
android:id="@+id/result_signature_action"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:drawableRight="@drawable/ic_vpn_key_grey_24dp"
|
android:paddingLeft="8dp"
|
||||||
android:drawablePadding="8dp"
|
android:paddingRight="8dp"
|
||||||
android:gravity="center_vertical"
|
android:id="@+id/result_signature_action"
|
||||||
android:text=""
|
android:measureAllChildren="true"
|
||||||
tools:text="Show"
|
android:inAnimation="@anim/fade_in"
|
||||||
/>
|
android:outAnimation="@anim/fade_out"
|
||||||
|
custom:initialView="0"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:drawableRight="@drawable/ic_vpn_key_grey_24dp"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/decrypt_result_action_show"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:drawableRight="@drawable/ic_file_download_grey_24dp"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/decrypt_result_action_Lookup"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
|
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user