aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-01-07 22:59:39 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-01-07 22:59:39 +0100
commita2f0667593be2f7ecd5b0e2445321a22a90eea9e (patch)
tree4bef45c713467ca6d146f71af3e177df25a224dc /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java
parentcaf3b02042f94b7b2a9b019b01d45c41bf035140 (diff)
downloadopen-keychain-a2f0667593be2f7ecd5b0e2445321a22a90eea9e.tar.gz
open-keychain-a2f0667593be2f7ecd5b0e2445321a22a90eea9e.tar.bz2
open-keychain-a2f0667593be2f7ecd5b0e2445321a22a90eea9e.zip
action encrypt to contact in view and multi select
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java
index d7e2b8063..7d51c2ff4 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyViewActivity.java
@@ -50,6 +50,9 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.format.DateFormat;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -67,6 +70,7 @@ public class KeyViewActivity extends KeyActivity implements CreateNdefMessageCal
private TextView mFingerint;
private TextView mExpiry;
private TextView mCreation;
+ private Button mActionEncrypt;
// NFC
private NfcAdapter mNfcAdapter;
@@ -86,6 +90,7 @@ public class KeyViewActivity extends KeyActivity implements CreateNdefMessageCal
mExpiry = (TextView) this.findViewById(R.id.expiry);
mCreation = (TextView) this.findViewById(R.id.creation);
mAlgorithm = (TextView) this.findViewById(R.id.algorithm);
+ mActionEncrypt = (Button) this.findViewById(R.id.action_encrypt);
Intent intent = getIntent();
mDataUri = intent.getData();
@@ -146,7 +151,7 @@ public class KeyViewActivity extends KeyActivity implements CreateNdefMessageCal
}
}
};
-
+
deleteKey(mDataUri, Id.type.public_key, returnHandler);
return true;
}
@@ -172,6 +177,19 @@ public class KeyViewActivity extends KeyActivity implements CreateNdefMessageCal
mCreation.setText(DateFormat.getDateFormat(getApplicationContext()).format(
PgpKeyHelper.getCreationDate(mPublicKey)));
mAlgorithm.setText(PgpKeyHelper.getAlgorithmInfo(mPublicKey));
+
+ mActionEncrypt.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ long[] encryptionKeyIds = new long[] { mPublicKey.getKeyID() };
+ Intent intent = new Intent(KeyViewActivity.this, EncryptActivity.class);
+ intent.setAction(EncryptActivity.ACTION_ENCRYPT);
+ intent.putExtra(EncryptActivity.EXTRA_ENCRYPTION_KEY_IDS, encryptionKeyIds);
+ // used instead of startActivity set actionbar based on callingPackage
+ startActivityForResult(intent, 0);
+ }
+ });
}
/**