aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wong <wongma7@outlook.com>2015-10-18 22:50:08 -0400
committerMatthew Wong <wongma7@outlook.com>2015-10-18 22:50:08 -0400
commit6abcebef184a58bef28c1584740e33b250486f85 (patch)
tree21dd548f10b4487ae72e7c3480491eed2d938bc4
parent91c7f8f558cc191f26804cd72bc50bbd257b194c (diff)
Offer #135 behaviour: if show time set to 0, don't clear clipboard or hide password for the user
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java17
1 files changed, 11 insertions, 6 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 6c8a1a61..9117a708 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -272,10 +272,15 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
TextView extraText = (TextView) findViewById(R.id.crypto_extra_show);
if (extraText.getText().length() != 0)
- ((LinearLayout) findViewById(R.id.crypto_extra_show_layout)).setVisibility(View.VISIBLE);
-
- this.pb = (ProgressBar) findViewById(R.id.pbLoading);
- this.pb.setMax(SHOW_TIME);
+ findViewById(R.id.crypto_extra_show_layout).setVisibility(View.VISIBLE);
+
+ if (SHOW_TIME == 0) {
+ // treat 0 as forever, and the user must exit and/or clear clipboard on their own
+ cancel(true);
+ } else {
+ this.pb = (ProgressBar) findViewById(R.id.pbLoading);
+ this.pb.setMax(SHOW_TIME);
+ }
}
}
@@ -302,8 +307,7 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
}
}
if (showPassword && findViewById(R.id.crypto_password_show) != null) {
- //clear password
- // if decrypt layout changed to encrypt layout via edit button, no need for this
+ // clear password; if decrypt changed to encrypt layout via edit button, no need
((TextView) findViewById(R.id.crypto_password_show)).setText("");
((TextView) findViewById(R.id.crypto_extra_show)).setText("");
findViewById(R.id.crypto_extra_show_layout).setVisibility(View.INVISIBLE);
@@ -406,6 +410,7 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
new DelayShow().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if (!showPassword) {
+ // stop here, but still need DelayShow to clear clipboard
activity.setResult(RESULT_CANCELED);
activity.finish();
}