summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java5
-rw-r--r--app/src/main/res/layout/encrypt_layout.xml10
2 files changed, 14 insertions, 1 deletions
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 28aea81e..9c0bc877 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -1,6 +1,7 @@
package com.zeapo.pwdstore.crypto;
import android.app.Activity;
+import android.app.DialogFragment;
import android.app.PendingIntent;
import android.content.ClipData;
import android.content.ClipboardManager;
@@ -28,6 +29,7 @@ import android.widget.Toast;
import com.google.common.primitives.Longs;
import com.zeapo.pwdstore.R;
import com.zeapo.pwdstore.UserPreference;
+import com.zeapo.pwdstore.pwgenDialogFragment;
import com.zeapo.pwdstore.utils.PasswordRepository;
import org.apache.commons.io.FileUtils;
@@ -174,6 +176,9 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
case R.id.crypto_get_key_ids:
getKeyIds(new Intent());
break;
+ case R.id.generate_password:
+ DialogFragment df = new pwgenDialogFragment();
+ df.show(getFragmentManager(), "generator");
default:
// should not happen
diff --git a/app/src/main/res/layout/encrypt_layout.xml b/app/src/main/res/layout/encrypt_layout.xml
index 5fc93b3c..dcb6bf88 100644
--- a/app/src/main/res/layout/encrypt_layout.xml
+++ b/app/src/main/res/layout/encrypt_layout.xml
@@ -64,7 +64,15 @@
android:id="@+id/crypto_password_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:typeface="monospace"/>
+ android:typeface="monospace"
+ android:layout_weight="1"/>
+ <ImageButton
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:src="@drawable/ic_action_new"
+ android:background="@drawable/blue_rectangle"
+ android:id="@+id/generate_password"
+ android:onClick="handleClick"/>
</LinearLayout>
<TextView