aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorGigahawk <jasperchan515@gmail.com>2020-02-23 18:07:29 -0800
committerGitHub <noreply@github.com>2020-02-24 07:37:29 +0530
commit4afb23bbb48d71beab801b21d05275e915722ae5 (patch)
treebb70b5d8ad3125cfac86221e38a0fad6af381894 /app/src/main/java
parent1a38ecbe75a60943c125b2c90a6e61d1a71bc158 (diff)
Add longpress to copy implicit username (#635)
* Add longpress to copy implicit username * Address review comments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt6
1 files changed, 6 insertions, 0 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 7acb22d4..4e49dfe3 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
@@ -124,6 +124,12 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
setContentView(R.layout.decrypt_layout)
crypto_password_category_decrypt.text = relativeParentPath
crypto_password_file.text = name
+ crypto_password_file.setOnLongClickListener {
+ val clip = ClipData.newPlainText("pgp_handler_result_pm", name)
+ clipboard.setPrimaryClip(clip)
+ showSnackbar(this.resources.getString(R.string.clipboard_username_toast_text))
+ true
+ }
crypto_password_last_changed.text = try {
this.resources.getString(R.string.last_changed, lastChangedString)