diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index 8ba418d1..db2acfac 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -77,10 +77,16 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { } "ENCRYPT" -> { setContentView(R.layout.encrypt_layout) + + generate_password?.setOnClickListener { + pwgenDialogFragment().show(fragmentManager, "generator") + } + title = getString(R.string.new_password_title) crypto_password_category.text = getRelativePath(fullPath, repoPath) } } + } override fun onDestroy() { @@ -117,17 +123,6 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { return true } - fun handleClick(view: View) { - when (view.id) { - R.id.generate_password -> { - val df = pwgenDialogFragment() - df.show(fragmentManager, "generator") - Log.wtf(TAG, "This should not happen.... PgpHandler.java#handleClick(View) default reached.") - } - else -> Log.wtf(TAG, "This should not happen.... PgpHandler.java#handleClick(View) default reached.") - }// should not happen - } - /** * Shows a simple toast message */ @@ -318,6 +313,9 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { */ private fun editPassword() { setContentView(R.layout.encrypt_layout) + generate_password?.setOnClickListener { + pwgenDialogFragment().show(fragmentManager, "generator") + } title = getString(R.string.edit_password_title) |