aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorzeapo <mohamed@zenadi.com>2017-11-03 15:03:44 +0100
committerzeapo <mohamed@zenadi.com>2017-11-03 15:03:44 +0100
commit7337be52140848985f428c44a2627ae23c19028f (patch)
treef7931efdfa3b3e1c766d68528be425cb6fe9a4ac /app/src/main/java
parentae3924673245f0d40d41ec313f2146c0f3943ef0 (diff)
replace the onclick by a listener
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt20
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)