aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain-API-Demo
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2013-09-08 17:04:33 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2013-09-08 17:04:33 +0200
commit4d1d3f6f5ea2eca224965ed3a2f1de5c551453fc (patch)
tree3b59394f6fdc4eb331ec318b2a19274ee4f99205 /OpenPGP-Keychain-API-Demo
parent6fdae001cc5ee742cceaeea82c75f0e314a3449f (diff)
downloadopen-keychain-4d1d3f6f5ea2eca224965ed3a2f1de5c551453fc.tar.gz
open-keychain-4d1d3f6f5ea2eca224965ed3a2f1de5c551453fc.tar.bz2
open-keychain-4d1d3f6f5ea2eca224965ed3a2f1de5c551453fc.zip
Select pub key when email could not be found
Diffstat (limited to 'OpenPGP-Keychain-API-Demo')
-rw-r--r--OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml84
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java10
2 files changed, 51 insertions, 43 deletions
diff --git a/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml b/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml
index af1e345d6..47a8b6520 100644
--- a/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml
+++ b/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml
@@ -1,56 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
- <LinearLayout
+ <TextView
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
+ android:layout_height="wrap_content"
+ android:text="Encrypt UserIds (split with &apos;,&apos;)"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Encrypt User Id"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ <EditText
+ android:id="@+id/crypto_provider_demo_encrypt_user_id"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="dominik@dominikschuermann.de"
+ android:textAppearance="@android:style/TextAppearance.Small" />
- <EditText
- android:id="@+id/crypto_provider_demo_encrypt_user_id"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="dominik@dominikschuermann.de"
- android:textAppearance="@android:style/TextAppearance.Small" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Message"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Message"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ <EditText
+ android:id="@+id/crypto_provider_demo_message"
+ android:layout_width="match_parent"
+ android:layout_height="150dip"
+ android:scrollHorizontally="true"
+ android:scrollbars="vertical"
+ android:text="message"
+ android:textAppearance="@android:style/TextAppearance.Small" />
- <EditText
- android:id="@+id/crypto_provider_demo_message"
- android:layout_width="match_parent"
- android:layout_height="150dip"
- android:text="message"
- android:textAppearance="@android:style/TextAppearance.Small" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Ciphertext"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Ciphertext"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ <EditText
+ android:id="@+id/crypto_provider_demo_ciphertext"
+ android:layout_width="match_parent"
+ android:layout_height="150dip"
+ android:text="ciphertext"
+ android:textAppearance="@android:style/TextAppearance.Small" />
- <EditText
- android:id="@+id/crypto_provider_demo_ciphertext"
- android:layout_width="match_parent"
- android:layout_height="150dip"
- android:text="ciphertext"
- android:textAppearance="@android:style/TextAppearance.Small" />
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
<Button
android:id="@+id/crypto_provider_demo_encrypt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:onClick="encryptOnClick"
android:text="Encrypt" />
@@ -58,6 +61,7 @@
android:id="@+id/crypto_provider_demo_sign"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:onClick="signOnClick"
android:text="Sign" />
@@ -65,6 +69,7 @@
android:id="@+id/crypto_provider_demo_encrypt_and_sign"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:onClick="encryptAndSignOnClick"
android:text="Encrypt and Sign" />
@@ -72,8 +77,9 @@
android:id="@+id/crypto_provider_demo_decrypt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:onClick="decryptOnClick"
android:text="Decrypt" />
</LinearLayout>
-</ScrollView> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java
index ca8824815..cbd829578 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java
+++ b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java
@@ -35,12 +35,14 @@ import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.RemoteException;
+import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListAdapter;
+import android.widget.Scroller;
import android.widget.TextView;
public class CryptoProviderDemoActivity extends Activity {
@@ -48,7 +50,7 @@ public class CryptoProviderDemoActivity extends Activity {
EditText mMessage;
EditText mCiphertext;
- EditText mEncryptUserId;
+ EditText mEncryptUserIds;
private CryptoServiceConnection mCryptoServiceConnection;
@@ -61,7 +63,7 @@ public class CryptoProviderDemoActivity extends Activity {
mMessage = (EditText) findViewById(R.id.crypto_provider_demo_message);
mCiphertext = (EditText) findViewById(R.id.crypto_provider_demo_ciphertext);
- mEncryptUserId = (EditText) findViewById(R.id.crypto_provider_demo_encrypt_user_id);
+ mEncryptUserIds = (EditText) findViewById(R.id.crypto_provider_demo_encrypt_user_id);
selectCryptoProvider();
}
@@ -125,7 +127,7 @@ public class CryptoProviderDemoActivity extends Activity {
try {
mCryptoServiceConnection.getService().encrypt(inputBytes,
- new String[] { mEncryptUserId.getText().toString() }, encryptCallback);
+ mEncryptUserIds.getText().toString().split(","), encryptCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
}
@@ -146,7 +148,7 @@ public class CryptoProviderDemoActivity extends Activity {
try {
mCryptoServiceConnection.getService().encryptAndSign(inputBytes,
- new String[] { mEncryptUserId.getText().toString() }, encryptCallback);
+ mEncryptUserIds.getText().toString().split(","), encryptCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
}