diff options
-rw-r--r-- | app/build.gradle | 6 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 12 | ||||
-rw-r--r-- | app/src/main/res/drawable-hdpi/ico_copy.png | bin | 0 -> 235 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-mdpi/ico_copy.png | bin | 0 -> 191 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xhdpi/ico_copy.png | bin | 0 -> 263 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxhdpi/ico_copy.png | bin | 0 -> 345 bytes | |||
-rw-r--r-- | app/src/main/res/menu/pgp_handler.xml | 5 |
7 files changed, 20 insertions, 3 deletions
diff --git a/app/build.gradle b/app/build.gradle index 24f8ea18..33e2b78a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 20 - buildToolsVersion "20.0.0" + compileSdkVersion 19 + buildToolsVersion "19.1.0" defaultConfig { applicationId "com.zeapo.pwdstore" minSdkVersion 14 - targetSdkVersion 20 + targetSdkVersion 19 versionCode 6 versionName "1.1-b1" } diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index caf72fbf..36660a51 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -5,6 +5,8 @@ import android.app.Activity; import android.app.AlertDialog; import android.app.PendingIntent; import android.app.ProgressDialog; +import android.content.ClipData; +import android.content.ClipboardManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -57,6 +59,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB private String accountName = ""; SharedPreferences settings; private Activity activity; + ClipboardManager clipboard; + private ProgressDialog bindingDialog; @@ -78,6 +82,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB super.onCreate(savedInstanceState); this.activity = this; + this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); // some persistance settings = PreferenceManager.getDefaultSharedPreferences(this); @@ -128,6 +133,9 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB setResult(RESULT_OK); finish(); return true; + case R.id.copy_password: + ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", ((TextView) findViewById(R.id.crypto_password_show)).getText()); + clipboard.setPrimaryClip(clip); } return super.onOptionsItemSelected(item); } @@ -212,6 +220,10 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB @Override protected void onPostExecute(Boolean b) { + + ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!"); + clipboard.setPrimaryClip(clip); + //clear password ((TextView) findViewById(R.id.crypto_password_show)).setText(""); ((TextView) findViewById(R.id.crypto_extra_show)).setText(""); diff --git a/app/src/main/res/drawable-hdpi/ico_copy.png b/app/src/main/res/drawable-hdpi/ico_copy.png Binary files differnew file mode 100644 index 00000000..d4facfa3 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ico_copy.png diff --git a/app/src/main/res/drawable-mdpi/ico_copy.png b/app/src/main/res/drawable-mdpi/ico_copy.png Binary files differnew file mode 100644 index 00000000..b508dccb --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ico_copy.png diff --git a/app/src/main/res/drawable-xhdpi/ico_copy.png b/app/src/main/res/drawable-xhdpi/ico_copy.png Binary files differnew file mode 100644 index 00000000..5dd46582 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ico_copy.png diff --git a/app/src/main/res/drawable-xxhdpi/ico_copy.png b/app/src/main/res/drawable-xxhdpi/ico_copy.png Binary files differnew file mode 100644 index 00000000..0269afad --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ico_copy.png diff --git a/app/src/main/res/menu/pgp_handler.xml b/app/src/main/res/menu/pgp_handler.xml index f06508f1..f9f88da8 100644 --- a/app/src/main/res/menu/pgp_handler.xml +++ b/app/src/main/res/menu/pgp_handler.xml @@ -1,4 +1,9 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.zeapo.pwdstore.crypto.PgpHandler" > + <item android:title="Copy password" + android:icon="@drawable/ico_copy" + android:showAsAction="ifRoom" + android:id="@+id/copy_password" + /> </menu> |